后台管理页面权限管理优化,权限管理细化
This commit is contained in:
@@ -146,14 +146,33 @@ const columns = [
|
||||
{ title: '操作', key: 'actions', width: 150, fixed: 'right' as const }
|
||||
]
|
||||
|
||||
const getCurrentUserInfo = () => {
|
||||
try {
|
||||
const userInfoStr = localStorage.getItem('adminUserInfo')
|
||||
if (userInfoStr) {
|
||||
return JSON.parse(userInfoStr)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取当前用户信息失败', error)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
const fetchShopList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await adminShopApi.listShops({
|
||||
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 adminShopApi.listShops(params)
|
||||
shopList.value = res.list || []
|
||||
pagination.total = res.total || 0
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user