diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index c0c3de8..b98bf62 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -103,7 +103,8 @@ export default { type: 'warning' }).then(() => { this.$store.dispatch('LogOut').then(() => { - location.href = '/index'; + // location.href = '/index'; + this.$router.replace('/login') }) }).catch(() => { }); }, @@ -142,7 +143,7 @@ export default { text-align: left; font-style: normal; text-transform: none; - + } .navbarleft{ display: flex; @@ -241,4 +242,4 @@ export default { } } } - \ No newline at end of file + diff --git a/src/layout/components/breadword.vue b/src/layout/components/breadword.vue index d2f27b4..5aca33d 100644 --- a/src/layout/components/breadword.vue +++ b/src/layout/components/breadword.vue @@ -64,7 +64,8 @@ export default { type: 'warning' }).then(() => { this.$store.dispatch('LogOut').then(() => { - location.href = '/index'; + // location.href = '/index'; + this.$router.replace('/login') }) }).catch(() => { }); } diff --git a/src/router/index.js b/src/router/index.js index cb56065..f6fabdd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -182,7 +182,7 @@ Router.prototype.replace = function push(location) { }; export default new Router({ - mode: "history", // 去掉url中的# + // mode: "history", // 去掉url中的# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes, }); diff --git a/src/utils/request.js b/src/utils/request.js index ffb0d21..a5a1aea 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,6 +7,8 @@ import { tansParams, blobValidate } from "@/utils/ruoyi"; import cache from '@/plugins/cache' import { saveAs } from 'file-saver' +import router from '@/router' + let downloadLoadingInstance; // 是否显示重新登录 export let isRelogin = { show: false }; @@ -87,7 +89,8 @@ service.interceptors.response.use(res => { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { isRelogin.show = false; store.dispatch('LogOut').then(() => { - location.href = '/index'; + // location.href = '/index'; + router.replace('/login') }) }).catch(() => { isRelogin.show = false; diff --git a/src/views/components/ProjectDetails/Basic.vue b/src/views/components/ProjectDetails/Basic.vue index 1f231bc..c1becd8 100644 --- a/src/views/components/ProjectDetails/Basic.vue +++ b/src/views/components/ProjectDetails/Basic.vue @@ -207,7 +207,7 @@