- 在beta上启用EnableWXAuth2

This commit is contained in:
gazebo
2019-08-13 14:59:19 +08:00
parent d4270bf8c3
commit 567046a238
4 changed files with 17 additions and 11 deletions

View File

@@ -533,10 +533,11 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
}
valid := dao.StrictMakeMapByStructObject(payload, store, userName)
if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["OperatorRole"])); err != nil {
return 0, err
if globals.EnableWXAuth2 {
if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["OperatorRole"])); err != nil {
return 0, err
}
}
if payload["lng"] != nil || payload["lat"] != nil {
intLng := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["lng"], 0.0))
intLat := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["lat"], 0.0))
@@ -714,8 +715,10 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
return 0, fmt.Errorf("ID:%d不是合法的京西门店编号", store.ID)
}
db := dao.GetDB()
if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole); err != nil {
return 0, err
if globals.EnableWXAuth2 {
if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole); err != nil {
return 0, err
}
}
existingID := store.ID
store.Lng = jxutils.StandardCoordinate2Int(storeExt.FloatLng)

View File

@@ -2,10 +2,12 @@ package cms
import (
"testing"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
)
func TestCheckSkuDiffBetweenJxAndVendor(t *testing.T) {
vendorIDList := []int{}
storeIDList := []int{}
CheckSkuDiffBetweenJxAndVendor(vendorIDList, storeIDList)
CheckSkuDiffBetweenJxAndVendor(jxcontext.AdminCtx, vendorIDList, storeIDList)
}