添加登录
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { App } from 'vue'
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import { staticRoutes } from './routes/staticRoutes'
|
||||
import { configureNProgress } from './utils/utils'
|
||||
import { setupBeforeEachGuard } from './guards/beforeEach'
|
||||
import { setupAfterEachGuard } from './guards/afterEach'
|
||||
|
||||
// 创建路由实例
|
||||
export const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: staticRoutes, // 静态路由
|
||||
scrollBehavior: () => ({ left: 0, top: 0 }) // 滚动行为
|
||||
})
|
||||
|
||||
// 初始化路由
|
||||
export function initRouter(app: App<Element>): void {
|
||||
configureNProgress() // 顶部进度条
|
||||
setupBeforeEachGuard(router) // 路由前置守卫
|
||||
setupAfterEachGuard(router) // 路由后置守卫
|
||||
app.use(router)
|
||||
}
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import type { App } from 'vue'
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { staticRoutes } from './routes/staticRoutes'
|
||||
import { configureNProgress } from './utils/utils'
|
||||
import { setupBeforeEachGuard } from './guards/beforeEach'
|
||||
@@ -7,7 +7,7 @@ import { setupAfterEachGuard } from './guards/afterEach'
|
||||
|
||||
// 创建路由实例
|
||||
export const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
history: createWebHistory(),
|
||||
routes: staticRoutes, // 静态路由
|
||||
scrollBehavior: () => ({ left: 0, top: 0 }) // 滚动行为
|
||||
})
|
||||
|
||||
@@ -56,6 +56,7 @@ export const asyncRoutes: AppRouteRecord[] = [
|
||||
path: '/work',
|
||||
name: 'Work',
|
||||
component: RoutesAlias.Home,
|
||||
// component:'/work',
|
||||
meta: {
|
||||
title: 'menus.work.title',
|
||||
icon: '',
|
||||
@@ -64,7 +65,7 @@ export const asyncRoutes: AppRouteRecord[] = [
|
||||
children: [
|
||||
{
|
||||
path: 'order',
|
||||
name: 'Order',
|
||||
name: '工单列表',
|
||||
component: RoutesAlias.Order,
|
||||
meta: {
|
||||
title: 'menus.work.order',
|
||||
|
||||
@@ -29,6 +29,12 @@ export const staticRoutes: AppRouteRecordRaw[] = [
|
||||
component: () => import('@views/auth/forget-password/index.vue'),
|
||||
meta: { title: 'menus.forgetPassword.title', isHideTab: true, noLogin: true, setTheme: true }
|
||||
},
|
||||
{
|
||||
path: '/auth/feishu-callback',
|
||||
name: 'FeishuCallback',
|
||||
component: () => import('@/views/auth/feishu-callback.vue'),
|
||||
meta: { title: '飞书回调', noLogin: true, isHideTab: true }
|
||||
},
|
||||
{
|
||||
path: '/exception',
|
||||
component: Home,
|
||||
|
||||
@@ -55,4 +55,5 @@ export enum RoutesAlias {
|
||||
}
|
||||
|
||||
// 主页路由
|
||||
export const HOME_PAGE = RoutesAlias.Dashboard
|
||||
// export const HOME_PAGE = RoutesAlias.Dashboard
|
||||
export const HOME_PAGE = '/work/order'
|
||||
|
||||
Reference in New Issue
Block a user