[系统用户]可以创建、修改、删除超级管理员

This commit is contained in:
GoEdgeLab
2020-12-03 19:25:36 +08:00
parent ce0c63d1bc
commit cbd444eb77
6 changed files with 23 additions and 5 deletions

View File

@@ -28,6 +28,7 @@ func (this *CreatePopupAction) RunPost(params struct {
Pass1 string
Pass2 string
ModuleCodes []string
IsSuper bool
Must *actions.Must
CSRF *actionutils.CSRF
@@ -81,15 +82,13 @@ func (this *CreatePopupAction) RunPost(params struct {
Password: params.Pass1,
Fullname: params.Fullname,
ModulesJSON: modulesJSON,
IsSuper: false, // TODO 后期再开放创建超级用户
IsSuper: params.IsSuper,
})
if err != nil {
this.ErrorPage(err)
return
}
defer this.CreateLogInfo("创建系统用户 %d", createResp.AdminId)
// 通知更改

View File

@@ -34,6 +34,7 @@ func (this *UpdatePopupAction) RunGet(params struct {
"fullname": admin.Fullname,
"username": admin.Username,
"isOn": admin.IsOn,
"isSuper": admin.IsSuper,
}
moduleMaps := configloaders.AllModuleMaps()
@@ -62,6 +63,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
Pass2 string
ModuleCodes []string
IsOn bool
IsSuper bool
Must *actions.Must
CSRF *actionutils.CSRF
@@ -120,7 +122,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
Password: params.Pass1,
Fullname: params.Fullname,
ModulesJSON: modulesJSON,
IsSuper: false, // TODO 后期再开放创建超级用户
IsSuper: params.IsSuper,
IsOn: params.IsOn,
})
if err != nil {