修复token过期未清除bug

ywj_dev
曹晨晨 2 years ago
parent a4594ad8ff
commit 211a67fb29

@ -87,6 +87,7 @@ Vue.use(Element, {
Vue.config.productionTip = false
new Vue({
el: '#app',
router,

@ -1,6 +1,5 @@
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
@ -175,9 +174,13 @@ Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err)
}
export default new Router({
base: process.env.VUE_APP_CONTEXT_PATH,
mode: 'hash', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
routes: constantRoutes,
})

@ -6,6 +6,7 @@ import errorCode from '@/utils/errorCode'
import {tansParams, blobValidate} from "@/utils/ruoyi";
import cache from '@/plugins/cache'
import {saveAs} from 'file-saver'
import Cookies from 'js-cookie'
let downloadLoadingInstance;
// 是否显示重新登录
@ -96,7 +97,8 @@ service.interceptors.response.use(res => {
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
Cookies.remove()
location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
})
}).catch(() => {
isRelogin.show = false;

@ -238,8 +238,6 @@ export default {
});
this.getCookie();
}
};
</script>

Loading…
Cancel
Save