- avoid wrong judge ctx.userInfo == nil

This commit is contained in:
gazebo
2019-03-04 10:11:08 +08:00
parent 4d9bdd4e81
commit 0dbd1e4afe

View File

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