- avoid wrong judge ctx.userInfo == nil
This commit is contained in:
@@ -72,7 +72,10 @@ func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ctx.userInfo, err = auth.GetUserInfo(token)
|
||||
userInfo, err2 := auth.GetUserInfo(token)
|
||||
if err = err2; err == nil {
|
||||
ctx.userInfo = userInfo
|
||||
}
|
||||
}
|
||||
if err != nil && beego.BConfig.RunMode == "prod" {
|
||||
globals.SugarLogger.Debugf("token is invalid, token:%s", token)
|
||||
|
||||
Reference in New Issue
Block a user