- 老TOKEN调用user2/GetMyStoreList时,返回TOKEN无效或过期错,要求重新登录

This commit is contained in:
gazebo
2019-08-28 16:50:00 +08:00
parent 9e6a0148f8
commit 7cb6708165
2 changed files with 9 additions and 5 deletions

View File

@@ -207,12 +207,16 @@ func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeL
return storeList, err
}
func GetMyStoreListNew(ctx *jxcontext.Context) (storeList []*dao.StoreWithCityName, err error) {
func GetMyStoreListNew(ctx *jxcontext.Context) (storeList []*dao.StoreWithCityName, errCode string, err error) {
if !auth2.IsV2Token(ctx.GetToken()) {
return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
}
mobileNum, userID := ctx.GetMobileAndUserID()
if mobileNum == "" {
return nil, fmt.Errorf("不能得到用户手机号")
return nil, "", fmt.Errorf("不能得到用户手机号")
}
return GetStoreList4User(ctx, mobileNum, userID)
storeList, err = GetStoreList4User(ctx, mobileNum, userID)
return storeList, "", err
}
func GetStoreRoleList(ctx *jxcontext.Context) (roleList []*authz.RoleInfo, err error) {

View File

@@ -85,8 +85,8 @@ func (c *User2Controller) GetUsers() {
// @router /GetMyStoreList [get]
func (c *User2Controller) GetMyStoreList() {
c.callGetMyStoreList(func(params *tUser2GetMyStoreListParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetMyStoreListNew(params.Ctx)
return retVal, "", err
retVal, errCode, err = cms.GetMyStoreListNew(params.Ctx)
return retVal, errCode, err
})
}