- jxcontext.New
This commit is contained in:
@@ -80,11 +80,17 @@ func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Re
|
||||
ctx.userInfo = userInfo
|
||||
}
|
||||
}
|
||||
if err != nil && beego.BConfig.RunMode == "prod" {
|
||||
globals.SugarLogger.Debugf("token is invalid, token:%s", token)
|
||||
return nil, model.ErrCodeTokenIsInvalid, err
|
||||
if err == model.ErrTokenIsInvalid {
|
||||
if beego.BConfig.RunMode != "prod" {
|
||||
err = nil
|
||||
} else {
|
||||
errCode = model.ErrCodeTokenIsInvalid
|
||||
}
|
||||
}
|
||||
return ctx, "", nil
|
||||
if err == model.ErrTokenIsInvalid {
|
||||
globals.SugarLogger.Debugf("token is invalid, token:%s", token)
|
||||
}
|
||||
return ctx, errCode, err
|
||||
}
|
||||
|
||||
func (ctx *Context) GetUserName() string {
|
||||
|
||||
Reference in New Issue
Block a user