first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
class Utils {
createdRouterConfig (router) {
var menu = JSON.parse(localStorage.getItem("menu"));
var RouterConfig = []
menu.forEach(v => {
if (v.hasOwnProperty("children")) {
v.children.forEach(k => {
RouterConfig.push({
path: v.path + k.path,
name: k.path.split("/")[1],
component: () => import(`@/views${v.path}${k.path}.vue`),
meta: {
isLogin: true,
keepAlive: false
}
})
})
} else {
var fileName = v.path.replace(
v.path.substring(1,2),
v.path.substring(0,2).split("/")[1].toUpperCase()
)
RouterConfig.push({
path: v.path,
name: v.path.split("/")[1],
component: () => import(`@/views${fileName}.vue`),
meta: {
isLogin: true,
keepAlive: false
}
})
}
});
var fa = [
{
path: '/',
name: 'layout',
component: () => import(/* webpackChunkName: "Layout" */ '@/views/Layout.vue'),
children: RouterConfig
}
];
router.addRoutes(fa)
}
}
export default new Utils();