路由模式修改为最开始的hash模式解决和后端请求地址冲突问题

This commit is contained in:
YeMingfei666 2025-10-31 15:17:23 +08:00
parent 421fad369c
commit 6467e7767f
1 changed files with 1 additions and 1 deletions

View File

@ -676,7 +676,7 @@ export const constantRoutes: RouteRecordRaw[] = [
*
*/
const router = createRouter({
history: createWebHistory(),
history: createWebHashHistory(), //使用哈希模式,避免前端路由和后端请求地址冲突问题,比如前端路由 /order/index 后端路由 /order* 会冲突导致刷新页面成了请求
routes: constantRoutes,
// 刷新时,滚动条位置还原
scrollBehavior: () => ({ left: 0, top: 0 }),