修复tagsView退出不清除问题

master
许宏杰 1 year ago
parent 228d70232e
commit 8071a4a86c

@ -8,5 +8,4 @@ ENV = 'production'
VUE_APP_BASE_API = 'https://www.jichuanglanhai.com:9038'
#服务器环境退出登录问题
VUE_APP_LOGIN_OUT="/demo/netEwm"

@ -111,11 +111,8 @@ export default {
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
if (process.env.NODE_ENV == "production") {
location.href = process.env.VUE_APP_LOGIN_OUT + "/login";
} else {
location.href = "/login";
}
this.$store.dispatch("tagsView/closeVisitedView", []);
this.$router.replace("/login");
});
})
.catch(() => {});

@ -6,7 +6,9 @@ const state = {
const mutations = {
CLOSE_LIST: (state, list) => {
state.visitedViews = list;
state.visitedViews = [];
state.cachedViews = [];
state.iframeViews = [];
},
ADD_IFRAME_VIEW: (state, view) => {
if (state.iframeViews.some((v) => v.path === view.path)) return;
@ -128,6 +130,9 @@ const mutations = {
};
const actions = {
closeVisitedView({ commit }, view) {
commit("CLOSE_LIST", view);
},
addView({ dispatch }, view) {
dispatch("addVisitedView", view);
dispatch("addCachedView", view);

@ -120,11 +120,8 @@ service.interceptors.response.use(
.then(() => {
isRelogin.show = false;
store.dispatch("LogOut").then(() => {
if (process.env.NODE_ENV == "production") {
location.href = process.env.VUE_APP_LOGIN_OUT + "/login";
} else {
location.href = "/login";
}
store.dispatch("tagsView/closeVisitedView", []);
router.replace("/login");
});
})
.catch(() => {

Loading…
Cancel
Save