浏览代码

mod:换回 createWebHashHistory

panqiuyao 7 月之前
父节点
当前提交
d05e67e57b
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 1 1
      frontend/src/router/index.ts
  2. 1 2
      frontend/src/utils/appfun.ts

+ 1 - 1
frontend/src/router/index.ts

@@ -74,7 +74,7 @@ const routes: RouteRecordRaw[] = [
 ];
 
 const router = createRouter({
-    history: createWebHistory(), // 修改: 将 createWebHistory 改为 createWebHashHistory
+    history: createWebHashHistory(), // 修改: 将 createWebHistory 改为 createWebHashHistory
     routes
 });
 

+ 1 - 2
frontend/src/utils/appfun.ts

@@ -8,6 +8,5 @@ export  function getFilePath (file_path){
 
 //获取路由地址
 export  function getRouterUrl (href){
-    return window.location.origin+href
+    return window.location.origin+window.location.pathname+href
 }
-