aa
This commit is contained in:
@@ -503,10 +503,17 @@ func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeL
|
|||||||
return storeList, err
|
return storeList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMyStoreListNew(ctx *jxcontext.Context) (storesInfo interface{}, errCode string, err error) {
|
func GetMyStoreListNew(ctx *jxcontext.Context, version string) (storesInfo interface{}, errCode string, err error) {
|
||||||
if !auth2.IsV2Token(ctx.GetToken()) {
|
if !auth2.IsV2Token(ctx.GetToken()) {
|
||||||
return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
|
return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
|
||||||
}
|
}
|
||||||
|
if ctx.GetLoginType() == weixin.AuthTypeWxApp {
|
||||||
|
if configs, _ := dao.QueryConfigs(dao.GetDB(), "checkversion", model.ConfigTypeSys, ""); len(configs) > 0 {
|
||||||
|
if version == "" || configs[0].Value != version {
|
||||||
|
return nil, "", fmt.Errorf("当前APP版本过旧,数据显示有错误,请到'京西菜市'公众号下载最新版本APP!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
mobile, userID := ctx.GetMobileAndUserID()
|
mobile, userID := ctx.GetMobileAndUserID()
|
||||||
if mobile == "" {
|
if mobile == "" {
|
||||||
return nil, "", fmt.Errorf("不能得到用户手机号")
|
return nil, "", fmt.Errorf("不能得到用户手机号")
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ func (c *Auth2Controller) SendVerifyCode() {
|
|||||||
// @Param authSecret formData string true "不同登录类型的登录秘密,如果是localpass登录类型,是md5后的值(空串不要md5)"
|
// @Param authSecret formData string true "不同登录类型的登录秘密,如果是localpass登录类型,是md5后的值(空串不要md5)"
|
||||||
// @Param authID formData string false "登录ID,登录类型为localpass时依赖于authIDType,其它为相应登录类型的id"
|
// @Param authID formData string false "登录ID,登录类型为localpass时依赖于authIDType,其它为相应登录类型的id"
|
||||||
// @Param authIDType formData string false "只有在登录类型为localpass时,才有意义,分别为:userid2:用户名,email,mobile"
|
// @Param authIDType formData string false "只有在登录类型为localpass时,才有意义,分别为:userid2:用户名,email,mobile"
|
||||||
// @Param version formData string false "当app登录时,需要传版本号"
|
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /Login [post]
|
// @router /Login [post]
|
||||||
@@ -111,11 +110,11 @@ func (c *Auth2Controller) Login() {
|
|||||||
params.AuthSecret = GetComposedCode(&c.Controller, params.AuthSecret)
|
params.AuthSecret = GetComposedCode(&c.Controller, params.AuthSecret)
|
||||||
}
|
}
|
||||||
if params.AuthType == weixin.AuthTypeWxApp {
|
if params.AuthType == weixin.AuthTypeWxApp {
|
||||||
if configs, _ := dao.QueryConfigs(dao.GetDB(), "checkversion", model.ConfigTypeSys, ""); len(configs) > 0 {
|
//if configs, _ := dao.QueryConfigs(dao.GetDB(), "checkversion", model.ConfigTypeSys, ""); len(configs) > 0 {
|
||||||
if params.Version == "" || configs[0].Value != params.Version {
|
// if params.Version == "" || configs[0].Value != params.Version {
|
||||||
return nil, "", fmt.Errorf("当前APP版本过旧,数据显示有错误,请到'京西菜市'公众号下载最新版本APP!")
|
// return nil, "", fmt.Errorf("当前APP版本过旧,数据显示有错误,请到'京西菜市'公众号下载最新版本APP!")
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
params.AuthSecret = GetComposedCode2(&c.Controller, params.AuthSecret)
|
params.AuthSecret = GetComposedCode2(&c.Controller, params.AuthSecret)
|
||||||
}
|
}
|
||||||
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
|
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
|
||||||
|
|||||||
@@ -88,13 +88,14 @@ func (c *User2Controller) GetUsers() {
|
|||||||
|
|
||||||
// @Title 得到用户自己的门店列表
|
// @Title 得到用户自己的门店列表
|
||||||
// @Description 得到用户自己的门店列表
|
// @Description 得到用户自己的门店列表
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
|
// @Param version query string false "当app登录时,需要传版本号"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /GetMyStoreList [get]
|
// @router /GetMyStoreList [get]
|
||||||
func (c *User2Controller) GetMyStoreList() {
|
func (c *User2Controller) GetMyStoreList() {
|
||||||
c.callGetMyStoreList(func(params *tUser2GetMyStoreListParams) (retVal interface{}, errCode string, err error) {
|
c.callGetMyStoreList(func(params *tUser2GetMyStoreListParams) (retVal interface{}, errCode string, err error) {
|
||||||
retVal, errCode, err = cms.GetMyStoreListNew(params.Ctx)
|
retVal, errCode, err = cms.GetMyStoreListNew(params.Ctx, params.Version)
|
||||||
return retVal, errCode, err
|
return retVal, errCode, err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user