From f651f65c4c6e38599313e9d1af87ed2e82dbf37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 11 Nov 2022 19:38:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8D=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 11 ++--------- src/store/modules/common.js | 9 +-------- src/utils/org.js | 2 +- .../ChangeAuthPlanDetail/ChangeAuthPlanApp/index.vue | 2 +- .../ChangeAuthPlanAsset/index.vue | 4 ++-- .../AssetPermissionDetail/AssetPermissionAsset.vue | 2 +- .../sessions/SessionDetail/SessionDetailInfo.vue | 2 +- src/views/settings/Interface.vue | 4 ++-- src/views/settings/License.vue | 3 +-- .../RequestApplicationPerm/Detail/TicketDetail.vue | 2 +- .../tickets/RequestAssetPerm/Detail/TicketDetail.vue | 2 +- src/views/tickets/TicketFlow/Detail/TicketDetail.vue | 2 +- src/views/tickets/components/Comments.vue | 2 +- 13 files changed, 16 insertions(+), 31 deletions(-) diff --git a/src/App.vue b/src/App.vue index 8de84169c..fed5caa5f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,19 +1,12 @@ diff --git a/src/store/modules/common.js b/src/store/modules/common.js index f3ac0e80e..e26944216 100644 --- a/src/store/modules/common.js +++ b/src/store/modules/common.js @@ -2,8 +2,7 @@ import { optionUrlMeta } from '@/api/common' const getDefaultState = () => { return { - metaMap: {}, - isRouterAlive: true + metaMap: {} } } @@ -12,12 +11,6 @@ const state = getDefaultState() const mutations = { SET_URL_META: (state, { url, meta }) => { state.metaMap[url] = meta - }, - reload: (state) => { - state.isRouterAlive = false - setTimeout(() => { - state.isRouterAlive = true - }, 0) } } diff --git a/src/utils/org.js b/src/utils/org.js index ea18b8f77..6cd0a5d3d 100644 --- a/src/utils/org.js +++ b/src/utils/org.js @@ -30,7 +30,7 @@ async function changeOrg(org) { if (index !== -1) { location.href = path.substring(0, index) } - setTimeout(() => store.commit('common/reload'), 400) + setTimeout(() => location.reload(), 400) } } diff --git a/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanApp/index.vue b/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanApp/index.vue index 4d8ef9037..74ae7e95e 100644 --- a/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanApp/index.vue +++ b/src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanApp/index.vue @@ -98,7 +98,7 @@ export default { that.iHasObjects = [...that.iHasObjects, ...objects] that.$refs.select2.clearSelected() this.$message.success(this.$t('common.updateSuccessMsg')) - this.$store.commit('common/reload') + window.location.reload() this.$refs.listTable.$refs.ListTable.reloadTable() } } diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue index e420c086a..ecca8a67e 100644 --- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue +++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue @@ -93,7 +93,7 @@ export default { onAddSuccess: (items, that) => { this.$log.debug('AssetSelect value', that.assets) this.$message.success(this.$t('common.updateSuccessMsg')) - this.$store.commit('common/reload') + window.location.reload() } }, nodeRelationConfig: { @@ -120,7 +120,7 @@ export default { that.iHasObjects = [...that.iHasObjects, ...objects] that.$refs.select2.clearSelected() this.$message.success(this.$t('common.updateSuccessMsg')) - this.$store.commit('common/reload') + window.location.reload() }, performDelete: (item) => { const data = { diff --git a/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionAsset.vue b/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionAsset.vue index 526e73bc4..2e4fa30e8 100644 --- a/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionAsset.vue +++ b/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionAsset.vue @@ -93,7 +93,7 @@ export default { this.$message.success(this.$t('common.updateSuccessMsg')) this.$refs.ListTable.reloadTable() that.$refs.assetSelect.$refs.select2.clearSelected() - this.$store.commit('common/reload') + window.location.reload() } }, nodeRelationConfig: { diff --git a/src/views/sessions/SessionDetail/SessionDetailInfo.vue b/src/views/sessions/SessionDetail/SessionDetailInfo.vue index 4dc3315b8..1bb503e75 100644 --- a/src/views/sessions/SessionDetail/SessionDetailInfo.vue +++ b/src/views/sessions/SessionDetail/SessionDetailInfo.vue @@ -49,7 +49,7 @@ export default { const msg = vm.$t('sessions.TerminateTaskSendSuccessMsg') vm.$message.success(msg) window.setTimeout(function() { - this.$store.commit('common/reload') + window.location.reload() }, 50000) }) } diff --git a/src/views/settings/Interface.vue b/src/views/settings/Interface.vue index 2b1e7aeac..b5b7b8800 100644 --- a/src/views/settings/Interface.vue +++ b/src/views/settings/Interface.vue @@ -175,7 +175,7 @@ export default { }).then(() => { restoreInterface().then(res => { this.$message.success(res.success) - this.$store.commit('common/reload') + location.reload() }) }) }.bind(this) @@ -221,7 +221,7 @@ export default { } } updateInterface(form).then(res => { - this.$store.commit('common/reload') + location.reload() }) } } diff --git a/src/views/settings/License.vue b/src/views/settings/License.vue index c485534a4..d3d9c19a5 100644 --- a/src/views/settings/License.vue +++ b/src/views/settings/License.vue @@ -140,7 +140,6 @@ export default { window.open(url, '_blank') }, importLicense() { - const vm = this if (this.licenseFile['file'] === undefined) { return } @@ -149,7 +148,7 @@ export default { importLicense(formData).then(res => { if (res.status) { this.$message.success(res.msg) - setTimeout(() => vm.$store.commit('common/reload'), 500) + setTimeout(() => location.reload(), 500) } else { this.$message.error(res.msg) } diff --git a/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue index d07cb7c4e..c710e7625 100644 --- a/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestApplicationPerm/Detail/TicketDetail.vue @@ -236,7 +236,7 @@ export default { return toSafeLocalDateStr(dataStr) }, reloadPage() { - this.$store.commit('common/reload') + window.location.reload() }, handleApprove() { if (this.object.approval_step === this.object.process_map.length) { diff --git a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue index 82f93b6c3..8665046e5 100644 --- a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue +++ b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue @@ -244,7 +244,7 @@ export default { return toSafeLocalDateStr(dataStr) }, reloadPage() { - this.$store.commit('common/reload') + window.location.reload() }, handleApprove() { if (this.object.approval_step === this.object.process_map.length) { diff --git a/src/views/tickets/TicketFlow/Detail/TicketDetail.vue b/src/views/tickets/TicketFlow/Detail/TicketDetail.vue index 8d1db855d..c47920336 100644 --- a/src/views/tickets/TicketFlow/Detail/TicketDetail.vue +++ b/src/views/tickets/TicketFlow/Detail/TicketDetail.vue @@ -88,7 +88,7 @@ export default { return toSafeLocalDateStr(dataStr) }, reloadPage() { - this.$store.commit('common/reload') + window.location.reload() } } } diff --git a/src/views/tickets/components/Comments.vue b/src/views/tickets/components/Comments.vue index ea9513bf3..4e70e0bd6 100644 --- a/src/views/tickets/components/Comments.vue +++ b/src/views/tickets/components/Comments.vue @@ -199,7 +199,7 @@ export default { ) }, reloadPage() { - this.$store.commit('common/reload') + window.location.reload() } }