feat: 用户页面增加单位、角色、权限展示

This commit is contained in:
2024-09-22 01:26:18 +08:00
parent 215318e29e
commit 0b9e99d00f
2 changed files with 46 additions and 4 deletions

View File

@ -15,6 +15,11 @@ const logout = () => {
router.replaceAll('/pages/login/index')
}
const departmentMap = {
4: '重庆眩生花科技有限公司',
5: '重庆电子科技职业大学',
}
onMounted(() => {
toast.loading({
msg: '加载中...'
@ -32,8 +37,9 @@ onMounted(() => {
<WdCellGroup :border="true">
<WdCell title="用户名" :value="user.userinfo?.username || '-'" />
<WdCell title="邮箱" :value="user.userinfo?.email || '-'" />
<WdCell title="单位" :value="user.userinfo?.department_id || '-'" />
<WdCell title="角色" :value="user.userinfo?.roles.join('') || '-'" />
<WdCell title="单位" :value="user.userinfo?.department_id ? departmentMap[user.userinfo.department_id] : '-'" />
<WdCell title="角色" :value="user.userinfo?.roles.map(i => i.role_name).join(', ') || '-'" />
<WdCell title="权限" :value="user.userinfo?.jobs.map(i => i.job_name).join(', ') || '-'" />
</WdCellGroup>
<div class="px-4">
<wd-button plain hairline block type="error" @click="logout">退出账号</wd-button>