diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index df54a7ab7..0887db897 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -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) { diff --git a/controllers/cms_user2.go b/controllers/cms_user2.go index b957bf2cd..5409dd0f3 100644 --- a/controllers/cms_user2.go +++ b/controllers/cms_user2.go @@ -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 }) }