增加自动化代码选择业务库功能,增加无边框页面功能。 (#1264)
* feat:增加无边框页面路由 * 更改基础页面文字说明 * 修复安装插件路径穿越漏洞 * 添加业务库数据库选择功能 Co-authored-by: dzwvip <dzwvip@qq.com> Co-authored-by: znonymous <fly1029@yeah.net>
This commit is contained in:
committed by
GitHub
co-authored by
dzwvip
znonymous
parent
525b3a0da9
commit
05f8ae2aae
@@ -5,6 +5,7 @@ import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const routerListArr = []
|
||||
const notLayoutRouterArr = []
|
||||
const keepAliveRoutersArr = []
|
||||
|
||||
const formatRouter = (routes, routeMap) => {
|
||||
@@ -14,9 +15,16 @@ const formatRouter = (routes, routeMap) => {
|
||||
}
|
||||
item.meta.btns = item.btns
|
||||
item.meta.hidden = item.hidden
|
||||
routeMap[item.name] = item
|
||||
if (item.children && item.children.length > 0) {
|
||||
formatRouter(item.children, routeMap)
|
||||
if (item.meta.defaultMenu === true) {
|
||||
notLayoutRouterArr.push({
|
||||
...item,
|
||||
path: `/${item.path}`,
|
||||
})
|
||||
} else {
|
||||
routeMap[item.name] = item
|
||||
if (item.children && item.children.length > 0) {
|
||||
formatRouter(item.children, routeMap)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -72,6 +80,9 @@ export const useRouterStore = defineStore('router', () => {
|
||||
})
|
||||
formatRouter(asyncRouter, routeMap)
|
||||
baseRouter[0].children = asyncRouter
|
||||
if (notLayoutRouterArr.length !== 0) {
|
||||
baseRouter.push(...notLayoutRouterArr)
|
||||
}
|
||||
baseRouter.push({
|
||||
path: '/:catchAll(.*)',
|
||||
redirect: '/layout/404'
|
||||
|
||||
Reference in New Issue
Block a user