From 9a813cced3ddc2348930e34b561514b63a05088f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Wed, 5 Jan 2022 21:58:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/SysUserController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs index 25f915e..f26d399 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs @@ -70,13 +70,14 @@ namespace ZR.Admin.WebApi.Controllers.System { Dictionary dic = new(); var roles = RoleService.SelectRoleAll(); - dic.Add("roles", roles); + dic.Add("roles", SysUser.IsAdmin(userId) ? roles : roles.FindAll(f => !f.IsAdmin())); dic.Add("posts", PostService.GetAll()); //编辑 if (userId > 0) { - dic.Add("user", UserService.SelectUserById(userId)); + SysUser sysUser = UserService.SelectUserById(userId); + dic.Add("user", sysUser); dic.Add("postIds", UserPostService.GetUserPostsByUserId(userId)); dic.Add("roleIds", RoleService.SelectUserRoles(userId)); }