This commit is contained in:
gazebo
2018-11-01 19:32:07 +08:00
parent 0428e3580f
commit 1e56ec2460

View File

@@ -6,7 +6,6 @@ import (
"git.rosy.net.cn/jx-callback/business/jxcallback/auth"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
)
@@ -29,7 +28,13 @@ var (
)
func init() {
AdminCtx, _, _ = New(nil, "jxadmin", nil, nil)
AdminCtx = &Context{
rootTask: nil,
token: "jxadmin",
w: nil,
r: nil,
mapData: make(map[interface{}]interface{}),
}
}
func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Request) (ctx *Context, errCode string, err error) {
@@ -42,8 +47,8 @@ func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Re
}
ctx.userInfo, err = auth.GetUserInfo(token)
if err != nil && beego.BConfig.RunMode == "prod" {
globals.SugarLogger.Warnf("token is invalid, token:%s", token)
return nil, "", err
// globals.SugarLogger.Warnf("token is invalid, token:%s", token)
// return nil, "", err
}
return ctx, "", nil
}