mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 新增主题配置
This commit is contained in:
@ -6,7 +6,7 @@ import createRouterGuide from './permission';
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [...customRoutes];
|
||||
|
||||
const router = createRouter({
|
||||
export const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes
|
||||
});
|
||||
|
@ -1,5 +1,4 @@
|
||||
import type { Router } from 'vue-router';
|
||||
import { NProgress } from '@/plugins';
|
||||
|
||||
/**
|
||||
* 路由守卫函数
|
||||
@ -7,10 +6,10 @@ import { NProgress } from '@/plugins';
|
||||
*/
|
||||
export default function createRouterGuide(router: Router) {
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start();
|
||||
window.$loadingBar?.start();
|
||||
next();
|
||||
});
|
||||
router.afterEach(() => {
|
||||
NProgress.done();
|
||||
window.$loadingBar?.finish();
|
||||
});
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
import { BasicLayout } from '@/layouts';
|
||||
|
||||
/**
|
||||
* 自定义路由
|
||||
@ -7,16 +8,19 @@ export const customRoutes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
name: 'root',
|
||||
path: '/',
|
||||
redirect: 'home'
|
||||
},
|
||||
{
|
||||
name: 'home',
|
||||
path: '/home',
|
||||
component: () => import('@/views/home/index.vue')
|
||||
},
|
||||
{
|
||||
name: 'system',
|
||||
path: '/system',
|
||||
component: () => import('@/views/system/index.vue')
|
||||
redirect: '/home',
|
||||
component: BasicLayout,
|
||||
children: [
|
||||
{
|
||||
name: 'home',
|
||||
path: '/home',
|
||||
component: () => import('@/views/home/index.vue')
|
||||
},
|
||||
{
|
||||
name: 'system',
|
||||
path: '/system',
|
||||
component: () => import('@/views/system/index.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
Reference in New Issue
Block a user