fix 普通用户权限视图

This commit is contained in:
jxxghp
2024-10-22 10:43:50 +08:00
parent 7e30cf40a9
commit 3f9b9a6903
3 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ export interface NavLink extends NavLinkProps, Partial<AclProperties> {
export interface NavMenu extends NavLink { export interface NavMenu extends NavLink {
header: string header: string
description?: string description?: string
permission?: string admin?: boolean
} }
// 👉 Vertical nav group // 👉 Vertical nav group
+1 -1
View File
@@ -36,7 +36,7 @@ const systemMenus = ref<NavMenu[]>([])
// 根据分类获取菜单列表 // 根据分类获取菜单列表
const getMenuList = (header: string) => { const getMenuList = (header: string) => {
return SystemNavMenus.filter((item: NavMenu) => item.header === header && superUser) return SystemNavMenus.filter((item: NavMenu) => item.header === header && (superUser || !item.admin))
} }
// 返回上一页 // 返回上一页
+13 -13
View File
@@ -5,21 +5,21 @@ export const SystemNavMenus = [
icon: 'mdi-home-outline', icon: 'mdi-home-outline',
to: '/dashboard', to: '/dashboard',
header: '开始', header: '开始',
permission: 'dashboard', admin: false,
}, },
{ {
title: '推荐', title: '推荐',
icon: 'mdi-star-outline', icon: 'mdi-star-outline',
to: '/ranking', to: '/ranking',
header: '发现', header: '发现',
permission: 'ranking', admin: false,
}, },
{ {
title: '资源搜索', title: '资源搜索',
icon: 'mdi-magnify', icon: 'mdi-magnify',
to: '/resource', to: '/resource',
header: '发现', header: '发现',
permission: 'resource.search', admin: false,
}, },
{ {
title: '电影', title: '电影',
@@ -27,7 +27,7 @@ export const SystemNavMenus = [
icon: 'mdi-movie-open-outline', icon: 'mdi-movie-open-outline',
to: '/subscribe/movie', to: '/subscribe/movie',
header: '订阅', header: '订阅',
permission: 'subscribe.movie', admin: false,
}, },
{ {
title: '电视剧', title: '电视剧',
@@ -35,7 +35,7 @@ export const SystemNavMenus = [
icon: 'mdi-television', icon: 'mdi-television',
to: '/subscribe/tv', to: '/subscribe/tv',
header: '订阅', header: '订阅',
permission: 'subscribe.tv', admin: false,
}, },
{ {
title: '日历', title: '日历',
@@ -43,56 +43,56 @@ export const SystemNavMenus = [
icon: 'mdi-calendar', icon: 'mdi-calendar',
to: '/calendar', to: '/calendar',
header: '订阅', header: '订阅',
permission: 'subscribe.calendar', admin: false,
}, },
{ {
title: '正在下载', title: '正在下载',
icon: 'mdi-download-outline', icon: 'mdi-download-outline',
to: '/downloading', to: '/downloading',
header: '整理', header: '整理',
permission: 'downloading.view', admin: false,
}, },
{ {
title: '历史记录', title: '历史记录',
icon: 'mdi-history', icon: 'mdi-history',
to: '/history', to: '/history',
header: '整理', header: '整理',
permission: 'admin', admin: true,
}, },
{ {
title: '文件管理', title: '文件管理',
icon: 'mdi-folder-multiple-outline', icon: 'mdi-folder-multiple-outline',
to: '/filemanager', to: '/filemanager',
header: '整理', header: '整理',
permission: 'admin', admin: true,
}, },
{ {
title: '插件', title: '插件',
icon: 'mdi-apps', icon: 'mdi-apps',
to: '/plugins', to: '/plugins',
header: '系统', header: '系统',
permission: 'admin', admin: true,
}, },
{ {
title: '站点管理', title: '站点管理',
icon: 'mdi-web', icon: 'mdi-web',
to: '/site', to: '/site',
header: '系统', header: '系统',
permission: 'admin', admin: true,
}, },
{ {
title: '用户管理', title: '用户管理',
icon: 'mdi-account-group', icon: 'mdi-account-group',
to: '/user', to: '/user',
header: '系统', header: '系统',
permission: 'usermanage', admin: true,
}, },
{ {
title: '设定', title: '设定',
icon: 'mdi-cog', icon: 'mdi-cog',
to: '/setting', to: '/setting',
header: '系统', header: '系统',
permission: 'admin', admin: true,
}, },
] ]