diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs index 605f7ef8..da355365 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs @@ -114,23 +114,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// [HttpGet] public async Task GetRolesByUserId(int userId) -<<<<<<< Updated upstream -<<<<<<< Updated upstream -<<<<<<< Updated upstream -<<<<<<< Updated upstream { var roleList = await _userService.GetRolesByUser(new user() { id=userId}); -======= -======= ->>>>>>> Stashed changes -======= ->>>>>>> Stashed changes -======= ->>>>>>> Stashed changes - { - var _user =await _userService.GetEntityById(userId); - var roleList = await _userService.GetRolesByUser(_user); ->>>>>>> Stashed changes return Result.Success().SetData(roleList); } /// diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db index 8f8280d7..62b8f9b6 100644 Binary files a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db and b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db differ diff --git a/Yi.Vue/src/views/AdmUser.vue b/Yi.Vue/src/views/AdmUser.vue index 620c6122..fe42156d 100644 --- a/Yi.Vue/src/views/AdmUser.vue +++ b/Yi.Vue/src/views/AdmUser.vue @@ -36,13 +36,17 @@ export default { methods: { async showItem(item) { var strInfo = ""; - Object.keys(item).forEach(function (key) { + userApi.GetRolesByUserId(item.id).then(async(resp)=>{ + +const roleData=resp.data; +strInfo+="拥有的角色:
" +roleData.forEach(u=>{strInfo+=u.role_name+"
"}) + +strInfo+="
" + Object.keys(item).forEach(async function (key) { strInfo += key + ":" + item[key] + "
"; }); - userApi.GetRolesByUserId(item.id).then(resp=>{ -const roleData=resp.data; -roleData.forEach(u=>{strInfo+="角色名:"+u.role_name}) -}) + await this.$dialog.confirm({ text: strInfo, title: "信息详情", @@ -50,6 +54,11 @@ roleData.forEach(u=>{strInfo+="角色名:"+u.role_name}) true: "关闭", }, }); + + + +}) + }, init() { roleApi.getRole().then((resp) => {