mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
[系统用户]可以创建、修改、删除超级管理员
This commit is contained in:
@@ -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)
|
||||
|
||||
// 通知更改
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -33,6 +33,13 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否为超级管理员</td>
|
||||
<td>
|
||||
<checkbox name="isSuper" v-model="isSuper"></checkbox>
|
||||
<p class="comment">超级管理员自动拥有所有的管理权限。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="!isSuper">
|
||||
<td>权限</td>
|
||||
<td>
|
||||
<div class="modules-box">
|
||||
|
||||
3
web/views/@default/admins/createPopup.js
Normal file
3
web/views/@default/admins/createPopup.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.isSuper = false
|
||||
})
|
||||
@@ -23,7 +23,7 @@
|
||||
<label-on :v-is-on="admin.isOn"></label-on>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="updateAdmin(admin.id)" v-if="!admin.isSuper">修改</a> <a href="" v-if="!admin.isSuper" @click.prevent="deleteAdmin(admin.id)">删除</a>
|
||||
<a href="" @click.prevent="updateAdmin(admin.id)">修改</a> <a href="" @click.prevent="deleteAdmin(admin.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -36,6 +36,13 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>是否为超级管理员</td>
|
||||
<td>
|
||||
<checkbox name="isSuper" v-model="admin.isSuper"></checkbox>
|
||||
<p class="comment">超级管理员自动拥有所有的管理权限。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="!admin.isSuper">
|
||||
<td>权限</td>
|
||||
<td>
|
||||
<div class="modules-box">
|
||||
|
||||
Reference in New Issue
Block a user