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