new Files

This commit is contained in:
2025-04-29 19:11:52 +08:00
parent 1a86b9bfc1
commit fe6fc6576d
90 changed files with 11768 additions and 663 deletions

54
front/src/router/index.ts Normal file
View File

@ -0,0 +1,54 @@
import type { App } from "vue";
import * as VueRouter from 'vue-router'
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
import Home from '@/pages/HomePage.vue'
import mjz from '@/pages/zl-station/menjizhenItemView.vue'
import zy from '@/pages/zl-station/zhuyuanItemView.vue'
import Login from '@/pages/LoginPage.vue'
import Page404 from '@/pages/404/notFoundPage.vue'
export const constantRoutes : RouteRecordRaw[] = [
{
path: '/',
component: Home
},
{
path: '/HomePage',
redirect: '/'
},
{
path: '/menjizhen-item',
component: () => import('@/pages/zl-station/menjizhenItemView.vue')
},
{
path: '/zhuyuan-item',
component: zy
},
{
path: '/login',
name: 'LoginView',
component: Login
},
// 通配符路由 - 必须放在最后
{
path: '/:pathMatch(.*)*', // 匹配所有路径
name: 'NotFound',
component: Page404
}
]
const router = createRouter({
history: VueRouter.createWebHistory(),
routes: constantRoutes,
// 刷新时,滚动条位置还原
scrollBehavior: () => ({ left: 0, top: 0 }),
})
// 全局注册 router
export function setupRouter(app: App<Element>) {
app.use(router);
}
export default router;