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() }