mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-03 15:40:19 +08:00
菜单调整,用户,消息通知,渠道
This commit is contained in:
@@ -7,6 +7,11 @@ import useUserStore from '@/stores/modules/user'
|
||||
// 匹配views里面所有的.vue文件,动态引入
|
||||
const modules = import.meta.glob('/src/views/**/*.vue')
|
||||
|
||||
//
|
||||
export function getModulesKey() {
|
||||
return Object.keys(modules).map((item) => item.replace('/src/views/', '').replace('.vue', ''))
|
||||
}
|
||||
|
||||
// 过滤路由所需要的数据
|
||||
export function filterAsyncRoutes(routes: any[], firstRoute = true) {
|
||||
return routes.map((route) => {
|
||||
@@ -31,7 +36,8 @@ export function createRouteRecord(route: any, firstRoute: boolean): RouteRecordR
|
||||
perms: route.perms,
|
||||
query: route.params,
|
||||
icon: route.menuIcon,
|
||||
type: route.menuType
|
||||
type: route.menuType,
|
||||
activeMenu: route.selected
|
||||
}
|
||||
}
|
||||
switch (route.menuType) {
|
||||
@@ -79,6 +85,10 @@ export function findFirstValidRoute(routes: RouteRecordRaw[]): string | undefine
|
||||
}
|
||||
}
|
||||
|
||||
export function getRoutePath(perms: string) {
|
||||
return router.getRoutes().find((item) => item.meta?.perms == perms)?.path || ''
|
||||
}
|
||||
|
||||
// 重置路由
|
||||
export function resetRouter() {
|
||||
router.removeRoute(INDEX_ROUTE_NAME)
|
||||
|
||||
@@ -47,52 +47,6 @@ export const constantRoutes: Array<RouteRecordRaw> = [
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/dev_tools',
|
||||
component: LAYOUT,
|
||||
children: [
|
||||
{
|
||||
path: 'code/edit',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/dev_tools/code/edit.vue'),
|
||||
meta: {
|
||||
title: '编辑数据表',
|
||||
activeMenu: '/dev_tools/code',
|
||||
name: Symbol()
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/setting',
|
||||
component: LAYOUT,
|
||||
children: [
|
||||
{
|
||||
path: 'dict/data',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/setting/dict/data/index.vue'),
|
||||
meta: {
|
||||
title: '数据管理',
|
||||
activeMenu: '/setting/dict'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/article',
|
||||
component: LAYOUT,
|
||||
children: [
|
||||
{
|
||||
path: 'lists/edit',
|
||||
name: Symbol(),
|
||||
component: () => import('@/views/article/lists/edit.vue'),
|
||||
meta: {
|
||||
title: '文章编辑',
|
||||
activeMenu: '/article/lists'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user