From 7dfa59e6e049c2c7759b3dfe2bf8d5a626c4aea8 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 27 Aug 2019 10:00:40 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=8C=BA=E5=88=86=E8=8F=9C=E5=B8=82?= =?UTF-8?q?=E4=B8=8E=E6=9E=9C=E5=9B=AD=E7=9A=84=E8=B0=83=E8=AF=95=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 3 ++- business/jxutils/jxutils.go | 33 ++++++++++++++++----------------- main.go | 6 +++++- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 9562e34e2..74f1baf65 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1808,7 +1808,8 @@ func AddStoreBossByMoble(ctx *jxcontext.Context, mobile string, storeID int) (nu num = 1 } } - } else { + } + if !globals.DisableWXAuth1 { num, err = BindMobile2Store(ctx, mobile, storeID) } } diff --git a/business/jxutils/jxutils.go b/business/jxutils/jxutils.go index b3081ac26..30681bb07 100644 --- a/business/jxutils/jxutils.go +++ b/business/jxutils/jxutils.go @@ -431,13 +431,14 @@ func HandleUserWXRemark(db *dao.DaoDB, mobile string, mobileIsUerID bool) (err e storeID := 0 remark := "" - if !globals.EnableWXAuth2 { + if !globals.DisableWXAuth1 { wxinfo, err := dao.GetUserStoreInfo(db, "tel", mobile) if err == nil { openID = wxinfo.OpenID storeID = wxinfo.JxStoreID } - } else { + } + if globals.EnableWXAuth2 { userID := "" if mobileIsUerID { userID = mobile @@ -459,23 +460,21 @@ func HandleUserWXRemark(db *dao.DaoDB, mobile string, mobileIsUerID bool) (err e } } - if err == nil { - if openID != "" { - if storeID > 0 { - store := &model.Store{} - store.ID = storeID - if err = dao.GetEntity(db, store); err == nil { - city := &model.Place{ - Code: store.CityCode, - } - if err = dao.GetEntity(db, city, "Code"); err == nil { - remark = city.Name + "-" + store.Name - } + if openID != "" { + if storeID > 0 { + store := &model.Store{} + store.ID = storeID + if err = dao.GetEntity(db, store); err == nil { + city := &model.Place{ + Code: store.CityCode, + } + if err = dao.GetEntity(db, city, "Code"); err == nil { + remark = city.Name + "-" + store.Name } } - if err == nil { - err = api.WeixinAPI.CBUpdateRemark(openID, remark) - } + } + if err == nil { + err = api.WeixinAPI.CBUpdateRemark(openID, remark) } } return err diff --git a/main.go b/main.go index 24850c004..38a15bf05 100644 --- a/main.go +++ b/main.go @@ -150,7 +150,11 @@ func main() { beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger" } go func() { - http.ListenAndServe("0.0.0.0:8899", nil) + if globals.IsMainProductEnv() { + http.ListenAndServe("0.0.0.0:6061", nil) + } else { + http.ListenAndServe("0.0.0.0:6060", nil) + } }() beego.Run() }