优化查询用户详细信息
This commit is contained in:
parent
2a14724473
commit
9a813cced3
@ -70,13 +70,14 @@ namespace ZR.Admin.WebApi.Controllers.System
|
||||
{
|
||||
Dictionary<string, object> 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));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user