From 85b53b9f9bee90758501ac6b64df1f4cc0e64b63 Mon Sep 17 00:00:00 2001 From: tengge1 <930372551@qq.com> Date: Tue, 5 Nov 2019 20:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++ .../Controllers/System/UserController.cs | 30 +++++++++++++++++-- ShadowEditor.Web/locales/zh-CN.json | 3 +- .../src/editor/system/user/EditUserWindow.jsx | 27 ++++++++++++++--- 4 files changed, 57 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7fdb6b16..25442e21 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ Supported Languages: 中文 / [繁體中文](README-tw.md) / [English](README-en 14. 新增鼠标移动到物体上的效果。 15. 新增选择模式设置。 16. 点击系统、组织机构管理,添加机构、添加子机构、删除机构、修改机构名称、设置机构管理员、保存编辑信息、重置编辑信息,测试无bug。 +17. 添加用户,添加用户名、密码、确认密码、姓名、角色、组织机构,没有bug。 +18. 编辑用户,修改用户名、姓名、角色、组织机构,没有bug。 +19. 删除用户,没有bug。 +20. ## v0.3.6更新 diff --git a/ShadowEditor.Server/Controllers/System/UserController.cs b/ShadowEditor.Server/Controllers/System/UserController.cs index 98eac101..0864fc72 100644 --- a/ShadowEditor.Server/Controllers/System/UserController.cs +++ b/ShadowEditor.Server/Controllers/System/UserController.cs @@ -179,7 +179,20 @@ namespace ShadowEditor.Server.Controllers.System if (string.IsNullOrEmpty(model.RoleID)) { - model.RoleID = ""; + return Json(new + { + Code = 300, + Msg = "Please select a role." + }); + } + + if (string.IsNullOrEmpty(model.DeptID)) + { + return Json(new + { + Code = 300, + Msg = "Please select a department." + }); } var mongo = new MongoHelper(); @@ -268,7 +281,20 @@ namespace ShadowEditor.Server.Controllers.System if (string.IsNullOrEmpty(model.RoleID)) { - model.RoleID = ""; + return Json(new + { + Code = 300, + Msg = "Please select a role." + }); + } + + if (string.IsNullOrEmpty(model.DeptID)) + { + return Json(new + { + Code = 300, + Msg = "Please select a department." + }); } var mongo = new MongoHelper(); diff --git a/ShadowEditor.Web/locales/zh-CN.json b/ShadowEditor.Web/locales/zh-CN.json index 60342b68..7238b0bb 100644 --- a/ShadowEditor.Web/locales/zh-CN.json +++ b/ShadowEditor.Web/locales/zh-CN.json @@ -901,5 +901,6 @@ "Please select a department.": "请选择机构。", "Selected Mode": "选择模式", "Select Whole": "选择整体", - "Select Part": "选择部分" + "Select Part": "选择部分", + "Please select a role.": "请选择角色" } \ No newline at end of file diff --git a/ShadowEditor.Web/src/editor/system/user/EditUserWindow.jsx b/ShadowEditor.Web/src/editor/system/user/EditUserWindow.jsx index 13e43997..31219c6c 100644 --- a/ShadowEditor.Web/src/editor/system/user/EditUserWindow.jsx +++ b/ShadowEditor.Web/src/editor/system/user/EditUserWindow.jsx @@ -13,7 +13,8 @@ class EditUserWindow extends React.Component { this.state = { id: props.id, username: props.username, - password: props.password, + password: '', + confirmPassword: '', name: props.name, roles: {}, roleID: props.roleID, @@ -29,12 +30,12 @@ class EditUserWindow extends React.Component { } render() { - const { id, username, password, name, roles, roleID, deptName } = this.state; + const { id, username, password, confirmPassword, name, roles, roleID, deptName } = this.state; return @@ -61,6 +62,14 @@ class EditUserWindow extends React.Component { onChange={this.handleChange} /> +