- disable token check on non prod server.

This commit is contained in:
gazebo
2018-11-05 16:10:49 +08:00
parent 5cfae50cc7
commit 95e6ab402e

View File

@@ -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
}