feat:实现项目团队加入功能

This commit is contained in:
lifei6671
2018-11-12 21:01:59 +08:00
parent 7785fb270d
commit 0f705f0249
13 changed files with 278 additions and 124 deletions

View File

@@ -45,9 +45,11 @@ func init() {
var StartRouter = func(ctx *context.Context) {
sessionId := ctx.Input.Cookie(beego.AppConfig.String("sessionname"))
//sessionId必须是数字字母组成且最小32个字符最大1024字符
if ok, err := regexp.MatchString(`^[a-zA-z0-9]{32,1024}$`, sessionId); !ok || err != nil {
panic("401")
if sessionId != "" {
//sessionId必须是数字字母组成且最小32个字符最大1024字符
if ok, err := regexp.MatchString(`^[a-zA-Z0-9]{32,512}$`, sessionId); !ok || err != nil {
panic("401")
}
}
}
beego.InsertFilter("/*", beego.BeforeStatic, StartRouter, false)