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

View File

@@ -132,8 +132,8 @@ func (c *User2Controller) GetRoleUserList() {
// @Title 给指定用户添加角色列表
// @Description 给指定用户添加角色列表
// @Param token header string true "认证token"
// @Param userID query string true "用户ID"
// @Param roleList query string true "角色列表"
// @Param userID formData string true "用户ID"
// @Param roleList formData string true "角色列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddRoles4User [post]
@@ -168,9 +168,9 @@ func (c *User2Controller) DeleteRoles4User() {
// @Title 给指定角色添加用户列表
// @Description 给指定角色添加用户列表
// @Param token header string true "认证token"
// @Param roleName query string true "角色名"
// @Param storeID query int false "门店ID"
// @Param userIDs query string true "用户ID列表"
// @Param roleName formData string true "角色名"
// @Param storeID formData int false "门店ID"
// @Param userIDs formData string true "用户ID列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AddUsers4Role [post]

View File

@@ -89,6 +89,7 @@ func Init() {
StoreName = beego.AppConfig.DefaultString("storeName", "京西菜市")
EnableNewAct = true
EnableWXAuth2 = beego.BConfig.RunMode == "beta"
}
func IsCallbackAlwaysReturnSuccess() bool {