浏览代码

fix: 修改路由模式

yongCode 5 月之前
父节点
当前提交
327958a476
共有 3 个文件被更改,包括 4 次插入5 次删除
  1. 1 1
      src/layout/components/Navbar.vue
  2. 1 1
      src/layoutMain/components/Navbar.vue
  3. 2 3
      src/router/index.js

+ 1 - 1
src/layout/components/Navbar.vue

@@ -76,7 +76,7 @@ function logout() {
     type: 'warning'
   }).then(() => {
     userStore.logOut().then(() => {
-      location.href = '/';
+      location.href = '/admin';
     })
   }).catch(() => { });
 }

+ 1 - 1
src/layoutMain/components/Navbar.vue

@@ -79,7 +79,7 @@ function logout() {
     type: 'warning'
   }).then(() => {
     userStore.logOut().then(() => {
-      location.href = '/';
+      location.href = '/admin';
     })
   }).catch(() => { });
 }

+ 2 - 3
src/router/index.js

@@ -1,4 +1,4 @@
-import { createWebHistory, createRouter } from "vue-router";
+import { createWebHashHistory, createRouter } from "vue-router";
 /* Layout */
 import Layout from "@/layoutMain";
 
@@ -199,9 +199,8 @@ export const dynamicRoutes = [
     ],
   },
 ];
-
 const router = createRouter({
-  history: createWebHistory(),
+  history: createWebHashHistory(),
   routes: constantRoutes,
   scrollBehavior(to, from, savedPosition) {
     if (savedPosition) {