后台管理页面权限管理优化
This commit is contained in:
@@ -60,7 +60,6 @@
|
|||||||
:loading="userLoading"
|
:loading="userLoading"
|
||||||
item-layout="horizontal"
|
item-layout="horizontal"
|
||||||
size="small"
|
size="small"
|
||||||
@click="selectUser"
|
|
||||||
>
|
>
|
||||||
<template #renderItem="{ item }">
|
<template #renderItem="{ item }">
|
||||||
<a-list-item
|
<a-list-item
|
||||||
@@ -73,7 +72,7 @@
|
|||||||
<a-avatar :src="item.avatar || DEFAULT_AVATAR" />
|
<a-avatar :src="item.avatar || DEFAULT_AVATAR" />
|
||||||
</template>
|
</template>
|
||||||
<template #title>{{ item.nickname }}</template>
|
<template #title>{{ item.nickname }}</template>
|
||||||
<template #description>{{ item.username }}</template>
|
<template #description>{{ item.account }}</template>
|
||||||
</a-list-item-meta>
|
</a-list-item-meta>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -272,9 +271,7 @@ const fetchUserList = async () => {
|
|||||||
size: 100,
|
size: 100,
|
||||||
keyword: userSearchText.value
|
keyword: userSearchText.value
|
||||||
})
|
})
|
||||||
console.log('获取到的用户列表响应:', res)
|
|
||||||
userList.value = res.list || []
|
userList.value = res.list || []
|
||||||
console.log('设置后的userList:', userList.value)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('获取用户列表失败')
|
message.error('获取用户列表失败')
|
||||||
} finally {
|
} finally {
|
||||||
@@ -293,12 +290,10 @@ const handleUserSearch = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const selectUser = async (user: UserVO) => {
|
const selectUser = async (user: UserVO) => {
|
||||||
console.log('选中的用户对象:', user)
|
|
||||||
selectedUser.value = user
|
selectedUser.value = user
|
||||||
assignLoading.value = true
|
assignLoading.value = true
|
||||||
try {
|
try {
|
||||||
const res = await permissionApi.getUserPermissions(user.id)
|
const res = await permissionApi.getUserPermissions(user.id)
|
||||||
console.log('获取到的用户权限:', res)
|
|
||||||
selectedPermissions.value = res.map(p => p.id)
|
selectedPermissions.value = res.map(p => p.id)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error('获取用户权限失败')
|
message.error('获取用户权限失败')
|
||||||
|
|||||||
Reference in New Issue
Block a user