This commit is contained in:
邹宗楠
2022-10-17 14:06:23 +08:00
parent 0695aa132c
commit 53fe97cbc1
49 changed files with 78 additions and 225 deletions

View File

@@ -4,7 +4,6 @@ import (
"errors"
"net/http"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/auth2"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
@@ -52,12 +51,10 @@ func New(notUsed interface{}, token string, w http.ResponseWriter, r *http.Reque
token: token,
Context: auth2.NewContext(w, r),
}
globals.SugarLogger.Debugf("jxcontext New, token:%s", token)
if auth2.IsV2Token(token) {
authInfo, err2 := auth2.GetTokenInfo(token)
if err = err2; err == nil {
ctx.userInfo = authInfo
globals.SugarLogger.Debugf("jxcontext New, V2 authInfo:%s", utils.Format4Output(authInfo, true))
if authInfo.TokenType != auth2.TokenTypeNormal {
err = errors.New("需要正式TOKEN")
}