- disable token check on non prod server.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
@@ -52,7 +53,7 @@ func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Re
|
||||
mapData: make(map[interface{}]interface{}),
|
||||
}
|
||||
ctx.userInfo, err = auth.GetUserInfo(token)
|
||||
if err != nil {
|
||||
if err != nil && beego.BConfig.RunMode == "prod" {
|
||||
globals.SugarLogger.Debugf("token is invalid, token:%s", token)
|
||||
return nil, model.ErrCodeTokenIsInvalid, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user