- fk
This commit is contained in:
@@ -63,10 +63,12 @@ func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Re
|
|||||||
mapData: make(map[interface{}]interface{}),
|
mapData: make(map[interface{}]interface{}),
|
||||||
accessUUID: utils.GetUUID(),
|
accessUUID: utils.GetUUID(),
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("jxcontext New, token:%s", token)
|
||||||
if auth2.IsV2Token(token) {
|
if auth2.IsV2Token(token) {
|
||||||
authInfo, err2 := auth2.GetTokenInfo(token)
|
authInfo, err2 := auth2.GetTokenInfo(token)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
ctx.userInfo = authInfo
|
ctx.userInfo = authInfo
|
||||||
|
globals.SugarLogger.Debugf("jxcontext New, V2 authInfo:%s", utils.Format4Output(authInfo, false))
|
||||||
if authInfo.TokenType != auth2.TokenTypeNormal {
|
if authInfo.TokenType != auth2.TokenTypeNormal {
|
||||||
err = errors.New("需要正式TOKEN")
|
err = errors.New("需要正式TOKEN")
|
||||||
}
|
}
|
||||||
@@ -74,6 +76,7 @@ func New(rootTask tasksch.ITask, token string, w http.ResponseWriter, r *http.Re
|
|||||||
} else {
|
} else {
|
||||||
userInfo, err2 := auth.GetUserInfo(token)
|
userInfo, err2 := auth.GetUserInfo(token)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
|
globals.SugarLogger.Debugf("jxcontext New, V1 authInfo:%s", utils.Format4Output(userInfo, false))
|
||||||
ctx.userInfo = userInfo
|
ctx.userInfo = userInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user