This commit is contained in:
橙子
2021-10-19 17:57:51 +08:00
parent 5915e15b05
commit 71a6878122
3 changed files with 14 additions and 20 deletions

View File

@@ -114,23 +114,8 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <returns></returns>
[HttpGet]
public async Task<Result> 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);
}
/// <summary>

View File

@@ -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+="拥有的角色:<br>"
roleData.forEach(u=>{strInfo+=u.role_name+"<br>"})
strInfo+="<hr>"
Object.keys(item).forEach(async function (key) {
strInfo += key + ":" + item[key] + "<br>";
});
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) => {