From 7cb6708165159c35ccb9cd89bc1f52b998359e80 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 28 Aug 2019 16:50:00 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E8=80=81TOKEN=E8=B0=83=E7=94=A8user2/GetMy?= =?UTF-8?q?StoreList=E6=97=B6=EF=BC=8C=E8=BF=94=E5=9B=9ETOKEN=E6=97=A0?= =?UTF-8?q?=E6=95=88=E6=88=96=E8=BF=87=E6=9C=9F=E9=94=99=EF=BC=8C=E8=A6=81?= =?UTF-8?q?=E6=B1=82=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/user2.go | 10 +++++++--- controllers/cms_user2.go | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) 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 }) }