Introducing new features. 修改首页内容放在菜单的第一行并且不由后端控制

This commit is contained in:
aeizzz 2023-02-13 13:36:35 +08:00
parent 616a7f8304
commit a717222fd6
2 changed files with 37 additions and 3 deletions

View File

@ -25,6 +25,25 @@ const layouModules: any = import.meta.glob('../layout/routerView/*.{vue,tsx}');
const viewsModules: any = import.meta.glob('../views/**/*.{vue,tsx}');
const dynamicViewsModules: Record<string, Function> = Object.assign({}, { ...layouModules }, { ...viewsModules });
const home = [
{
path: '/home',
name: 'home',
component: () => import('/@/views/home/index.vue'),
meta: {
title: 'router.home',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: true,
isIframe: false,
icon: 'iconfont icon-shouye',
},
},
]
/**
*
* @method NextLoading loading
@ -48,7 +67,7 @@ export async function initBackEndControlRoutes() {
// 存储接口原始路由未处理component根据需求选择使用
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
// 处理路由component替换 dynamicRoutes/@/router/route第一个顶级 children 的路由
dynamicRoutes[0].children = [...await backEndComponent(res.data), ...staticConfigRoutes]
dynamicRoutes[0].children = [...home,...await backEndComponent(res.data), ...staticConfigRoutes]
// 添加动态路由
await setAddRoute();
// 设置路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组

View File

@ -42,12 +42,27 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
path: '/',
name: '/',
component: () => import('/@/layout/index.vue'),
redirect: '/home/index',
redirect: '/home',
meta: {
title: 'hzxc',
isKeepAlive: true,
},
children: [],
children: [
{
path: '/home',
name: 'home',
component: () => import('/@/views/home/index.vue'),
meta: {
title: 'router.home',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: true,
isIframe: false,
icon: 'iconfont icon-shouye',
},
},
],
},
];