NEZ-2097 fix:点击筛选菜单页面自动回跳

This commit is contained in:
zyh
2022-08-03 16:24:00 +08:00
parent b563097cc9
commit 6b357a4baa
5 changed files with 13 additions and 2 deletions

View File

@@ -1224,6 +1224,9 @@ export default {
this.graphShow = show this.graphShow = show
} }
}, },
beforeDestroy () {
clearTimeout(this.timer)
},
destroyed () { destroyed () {
localStorage.removeItem('alertMessageProjectId') localStorage.removeItem('alertMessageProjectId')
} }

View File

@@ -910,6 +910,9 @@ export default {
this.getSnmpCredentialData() this.getSnmpCredentialData()
this.getFieldGroupData() this.getFieldGroupData()
}, },
beforeDestroy () {
clearTimeout(this.timer)
},
watch: { watch: {
$route: { $route: {
immediate: true, immediate: true,

View File

@@ -930,6 +930,9 @@ export default {
} }
} }
}, },
beforeDestroy () {
clearTimeout(this.timer)
},
destroyed () { destroyed () {
localStorage.removeItem('endpointProjectId') localStorage.removeItem('endpointProjectId')
} }

View File

@@ -114,7 +114,9 @@ export function get (url, params, responseType) {
if (err.response) { if (err.response) {
resolve(err.response.data) resolve(err.response.data)
} else if (err.message) { } else if (err.message) {
if (err.message !== 'cancel') { // 判断是否是路由跳转取消的请求是的话没必要提示message
resolve(err.message) resolve(err.message)
}
} else { } else {
resolve(err) resolve(err)
} }

View File

@@ -16,7 +16,7 @@ router.beforeEach((to, from, next) => {
return return
} }
if (store.getters.getNowPath !== to.path && store.getters.getNowPath !== '/login') { if (store.getters.getNowPath !== to.path && store.getters.getNowPath !== '/login') {
requestsArr.forEach(xhr => xhr.cancel()) requestsArr.forEach(xhr => xhr.cancel('cancel'))
} }
store.commit('setNowPath', to.path) store.commit('setNowPath', to.path)
const configUrl = 'static/config.json?Timestamp=' + new Date().getTime() const configUrl = 'static/config.json?Timestamp=' + new Date().getTime()