This commit is contained in:
邹宗楠
2024-07-19 17:26:33 +08:00
parent 556a0c63f0
commit 8ee95e3505

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"errors"
"git.rosy.net.cn/jx-callback/business/authz/autils"
"strings"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
@@ -154,6 +155,10 @@ func (c *StoreController) CreateStore() {
store := &cms.StoreExt{}
if err = utils.UnmarshalUseNumber([]byte(params.Payload), store); err == nil {
retVal, err = cms.CreateStore(params.Ctx, store, params.Ctx.GetUserName())
// 将创建门店用户添加到管理组
if retVal != 0 {
cms.AddUsers4Role(params.Ctx, autils.NewRole("StoreBoss", retVal.(int)), []string{params.Ctx.GetUserID()})
}
}
return retVal, "", err
})