diff --git a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs index b862ec1..78afc6e 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs @@ -150,7 +150,7 @@ namespace ZR.Admin.WebApi.Controllers.System public IActionResult Remove(int userid = 0) { if (userid <= 0) { return ToResponse(ApiResult.Error(101, "请求参数错误")); } - + if (userid == 1) return ToResponse(Infrastructure.ResultCode.FAIL, "不能删除管理员账号"); int result = UserService.DeleteUser(userid); return ToResponse(ToJson(result)); diff --git a/ZR.Repository/System/SysUserRepository.cs b/ZR.Repository/System/SysUserRepository.cs index 1128be6..10fb800 100644 --- a/ZR.Repository/System/SysUserRepository.cs +++ b/ZR.Repository/System/SysUserRepository.cs @@ -111,7 +111,7 @@ namespace ZR.Repository.System } /// - /// 删除用户(物理删除) + /// 删除用户(软删除) /// /// 用户id /// diff --git a/ZR.Vue/src/views/system/user/index.vue b/ZR.Vue/src/views/system/user/index.vue index 0f4352d..b9a205e 100644 --- a/ZR.Vue/src/views/system/user/index.vue +++ b/ZR.Vue/src/views/system/user/index.vue @@ -82,13 +82,13 @@ {{ parseTime(scope.row.createTime) }} - - + + @@ -306,8 +306,8 @@ export default { // { key: 6, label: `创建时间`, checked: true }, { key: 0, label: `登录IP`, checked: false }, { key: 1, label: `最后登录时间`, checked: false }, - { key: 2, label: `创建人`, checked: false }, - { key: 3, label: `备注`, checked: false }, + { key: 2, label: `创建人`, checked: false }, + { key: 3, label: `备注`, checked: false }, ], // 表单校验 rules: { @@ -467,13 +467,10 @@ export default { }, /** 修改按钮操作 */ handleUpdate(row) { - if(row.userId !== 1 | row.userName != 'admin'){ - this.msgError("不能对管理进行修改") - return; - } this.reset(); this.getTreeselect(); const userId = row.userId || this.ids; + getUser(userId).then((response) => { // this.form = response.data.user; var data = response.data; @@ -536,6 +533,10 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const userIds = row.userId || this.ids; + if (userIds == 1 || row.userName == "admin") { + this.msgError("不能对管理进行删除"); + return; + } this.$confirm( '是否确认删除用户编号为"' + userIds + '"的数据项?', "警告",