mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
feat:实现项目团队加入功能
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user