后台管理页面权限管理优化,权限管理细化

This commit is contained in:
xiaowang
2026-02-25 16:50:32 +08:00
parent f5b5b01a39
commit f468e5544c
20 changed files with 176 additions and 60 deletions
+21 -2
View File
@@ -177,14 +177,33 @@ const getUserTypeColor = (type: number) => {
return map[type] || 'default'
}
const getCurrentUserInfo = () => {
try {
const userInfoStr = localStorage.getItem('adminUserInfo')
if (userInfoStr) {
return JSON.parse(userInfoStr)
}
} catch (error) {
console.error('获取当前用户信息失败', error)
}
return null
}
const fetchUserList = async () => {
loading.value = true
try {
const res = await userApi.listUsers({
const currentUser = getCurrentUserInfo()
const params: any = {
page: pagination.current,
size: pagination.pageSize,
keyword: searchText.value
})
}
if (currentUser && currentUser.type !== 4 && currentUser.shopId) {
params.shopId = currentUser.shopId
}
const res = await userApi.listUsers(params)
userList.value = res.list || []
pagination.total = res.total || 0
} catch (error) {