- 在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)
|
valid := dao.StrictMakeMapByStructObject(payload, store, userName)
|
||||||
if err = dao.ValidateRoles(db, utils.Interface2String(valid["marketManRole"]), utils.Interface2String(valid["OperatorRole"])); err != nil {
|
if globals.EnableWXAuth2 {
|
||||||
return 0, err
|
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 {
|
if payload["lng"] != nil || payload["lat"] != nil {
|
||||||
intLng := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["lng"], 0.0))
|
intLng := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["lng"], 0.0))
|
||||||
intLat := jxutils.StandardCoordinate2Int(utils.Interface2Float64WithDefault(payload["lat"], 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)
|
return 0, fmt.Errorf("ID:%d不是合法的京西门店编号", store.ID)
|
||||||
}
|
}
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole); err != nil {
|
if globals.EnableWXAuth2 {
|
||||||
return 0, err
|
if err = dao.ValidateRoles(db, store.MarketManRole, store.OperatorRole); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
existingID := store.ID
|
existingID := store.ID
|
||||||
store.Lng = jxutils.StandardCoordinate2Int(storeExt.FloatLng)
|
store.Lng = jxutils.StandardCoordinate2Int(storeExt.FloatLng)
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ package cms
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCheckSkuDiffBetweenJxAndVendor(t *testing.T) {
|
func TestCheckSkuDiffBetweenJxAndVendor(t *testing.T) {
|
||||||
vendorIDList := []int{}
|
vendorIDList := []int{}
|
||||||
storeIDList := []int{}
|
storeIDList := []int{}
|
||||||
CheckSkuDiffBetweenJxAndVendor(vendorIDList, storeIDList)
|
CheckSkuDiffBetweenJxAndVendor(jxcontext.AdminCtx, vendorIDList, storeIDList)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ func (c *User2Controller) GetRoleUserList() {
|
|||||||
// @Title 给指定用户添加角色列表
|
// @Title 给指定用户添加角色列表
|
||||||
// @Description 给指定用户添加角色列表
|
// @Description 给指定用户添加角色列表
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param userID query string true "用户ID"
|
// @Param userID formData string true "用户ID"
|
||||||
// @Param roleList query string true "角色列表"
|
// @Param roleList formData string true "角色列表"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /AddRoles4User [post]
|
// @router /AddRoles4User [post]
|
||||||
@@ -168,9 +168,9 @@ func (c *User2Controller) DeleteRoles4User() {
|
|||||||
// @Title 给指定角色添加用户列表
|
// @Title 给指定角色添加用户列表
|
||||||
// @Description 给指定角色添加用户列表
|
// @Description 给指定角色添加用户列表
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param roleName query string true "角色名"
|
// @Param roleName formData string true "角色名"
|
||||||
// @Param storeID query int false "门店ID"
|
// @Param storeID formData int false "门店ID"
|
||||||
// @Param userIDs query string true "用户ID列表"
|
// @Param userIDs formData string true "用户ID列表"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /AddUsers4Role [post]
|
// @router /AddUsers4Role [post]
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ func Init() {
|
|||||||
StoreName = beego.AppConfig.DefaultString("storeName", "京西菜市")
|
StoreName = beego.AppConfig.DefaultString("storeName", "京西菜市")
|
||||||
|
|
||||||
EnableNewAct = true
|
EnableNewAct = true
|
||||||
|
EnableWXAuth2 = beego.BConfig.RunMode == "beta"
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsCallbackAlwaysReturnSuccess() bool {
|
func IsCallbackAlwaysReturnSuccess() bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user