修复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_BASE_API = 'https://www.jichuanglanhai.com:9038'
#服务器环境退出登录问题
VUE_APP_LOGIN_OUT="/demo/netEwm"

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

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

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

Loading…
Cancel
Save