- 在beta上启用EnableWXAuth2
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user