- 角色管理初版
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/auth"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/mobile"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/weixin"
|
||||
@@ -66,26 +65,8 @@ func GetSelfInfo(ctx *jxcontext.Context) (storeUserInfo *dao.StoreUserInfo, err
|
||||
return storeUserInfo, err
|
||||
}
|
||||
|
||||
func getMobileFromCtx(ctx *jxcontext.Context) (mobile string) {
|
||||
token := ctx.GetToken()
|
||||
if auth2.IsV2Token(token) {
|
||||
authInfo, err2 := auth2.GetTokenInfo(token)
|
||||
if err2 == nil {
|
||||
if authInfo.TokenType == auth2.TokenTypeNormal {
|
||||
mobile = authInfo.GetMobile()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
userInfo, err2 := auth.GetUserInfo(token)
|
||||
if err2 == nil {
|
||||
mobile = userInfo.GetAuthID()
|
||||
}
|
||||
}
|
||||
return mobile
|
||||
}
|
||||
|
||||
func GetMyStoreList(ctx *jxcontext.Context) (storeList []*dao.StoreWithCityName, err error) {
|
||||
mobileNum := getMobileFromCtx(ctx)
|
||||
mobileNum, _ := ctx.GetMobileAndUserID()
|
||||
if mobileNum == "" {
|
||||
return nil, fmt.Errorf("不能得到用户手机号")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user