hookehuyr

refactor(router): 将路由历史模式从createWebHistory更改为createWebHashHistory

为了确保在部署时路由能正确解析路径,将路由历史模式从createWebHistory更改为createWebHashHistory。这种模式更适合某些部署环境,特别是当服务器配置不支持前端路由时。
/*
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-21 15:45:42
* @LastEditTime: 2025-03-21 15:59:36
* @FilePath: /mlaj/src/router/index.js
* @Description: 文件描述
*/
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
import checkinRoutes from './checkin'
const routes = [
......@@ -125,7 +125,7 @@ const routes = [
]
const router = createRouter({
history: createWebHistory(import.meta.env.VITE_BASE || '/'),
history: createWebHashHistory(import.meta.env.VITE_BASE || '/'),
routes,
scrollBehavior(to, from, savedPosition) {
// 每次路由切换后,页面滚动到顶部
......