添加登录

This commit is contained in:
浅念
2025-07-11 18:37:16 +08:00
parent 719911918f
commit 713d43f7b4
34 changed files with 1281 additions and 180 deletions
+21
View File
@@ -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
View File
@@ -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 }) // 滚动行为
})
+2 -1
View File
@@ -56,6 +56,7 @@ export const asyncRoutes: AppRouteRecord[] = [
path: '/work',
name: 'Work',
component: RoutesAlias.Home,
// component:'/work',
meta: {
title: 'menus.work.title',
icon: '&#xe88b;',
@@ -64,7 +65,7 @@ export const asyncRoutes: AppRouteRecord[] = [
children: [
{
path: 'order',
name: 'Order',
name: '工单列表',
component: RoutesAlias.Order,
meta: {
title: 'menus.work.order',
+6
View File
@@ -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,
+2 -1
View File
@@ -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'