Bläddra i källkod

fix: 修改路由模式

yongCode 5 månader sedan
förälder
incheckning
327958a476
3 ändrade filer med 4 tillägg och 5 borttagningar
  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) {