From 092eb0f9ace7f6bd715ff55914f8ea1c6172159c Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 26 Nov 2021 14:05:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B8=85=E9=99=A4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=9A=84=E6=88=91=E6=9B=BF=E4=BD=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/App.vue | 7 +++++++ nezha-fronted/src/components/charts/chart-list.vue | 2 +- nezha-fronted/src/permission.js | 11 +---------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/nezha-fronted/src/App.vue b/nezha-fronted/src/App.vue index 793aee4c0..a0d76882b 100644 --- a/nezha-fronted/src/App.vue +++ b/nezha-fronted/src/App.vue @@ -15,6 +15,11 @@ export default { browserWindowZoom }, async created () { + const herfSpiltArr = window.location.href.split('/') + if (herfSpiltArr[3] !== '#') { + herfSpiltArr[3] = '#' + window.location.href = herfSpiltArr.join('/') + } const Timestamp = new Date().getTime() const url = 'static/config.json?Timestamp=' + Timestamp const result = await this.$http.get(url) @@ -24,6 +29,8 @@ export default { sessionStorage.clear() localStorage.clear() localStorage.setItem('nz-version', version) + herfSpiltArr[2] = herfSpiltArr[2] + '?t=' + new Date().getTime() + window.location.href = herfSpiltArr[0] + '//' + herfSpiltArr[2] } } } diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 32b4d8a0f..31a350f7d 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -1481,7 +1481,7 @@ export default { }, getEndpointInfoChartData (chartInfo) { const detail = [] - this.$refs['editChart' + chartInfo.id][0].showLoad() + this.$refs['editChart' + chartInfo.id][0] && this.$refs['editChart' + chartInfo.id][0].showLoad() chartInfo.name = this.$t('project.chart.endpointInfo') chartInfo.from = fromRoute.endpoint const basicInfo = JSON.parse(JSON.stringify(this.obj)) diff --git a/nezha-fronted/src/permission.js b/nezha-fronted/src/permission.js index a0f474bb9..8effb545b 100644 --- a/nezha-fronted/src/permission.js +++ b/nezha-fronted/src/permission.js @@ -20,16 +20,7 @@ router.beforeEach((to, from, next) => { if (res.inited === 0) { next({ path: '/setup' }) } else { - if (new Date().getTime() - to.query.t < 5 * 60 * 1000) { - next() - } else { - next({ - path: to.path, - query: { - t: new Date().getTime() - } - }) - } + next() } } })