From 90cbca0ab8b8435b535364371439c212478f0488 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Wed, 30 Aug 2023 15:27:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dlink=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=9B=BE=E5=8D=95=E4=BD=8D=E8=BD=AC=E6=8D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http.js | 16 ++++++++++------ .../LinkDirectionGrid/PopoverContent.vue | 18 +++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/utils/http.js b/src/utils/http.js index d132a5f1..ea268148 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -69,12 +69,16 @@ axios.interceptors.response.use( return response }, error => { - if (licenceErrorCode.indexOf(error.response.data.code) !== -1) { - localStorage.removeItem(storageKey.token) - window.location.href = '/' - } else if (accountErrorCode.indexOf(error.response.data.code) !== -1) { - localStorage.removeItem(storageKey.token) - window.location.href = '/' + try { + if (licenceErrorCode.indexOf(error.response.data.code) !== -1) { + localStorage.removeItem(storageKey.token) + window.location.href = '/' + } else if (accountErrorCode.indexOf(error.response.data.code) !== -1) { + localStorage.removeItem(storageKey.token) + window.location.href = '/' + } + } catch (e) { + console.error(e) } return Promise.reject(error) } diff --git a/src/views/charts2/charts/linkMonitor/LinkDirectionGrid/PopoverContent.vue b/src/views/charts2/charts/linkMonitor/LinkDirectionGrid/PopoverContent.vue index a0b634df..dcd44ba2 100644 --- a/src/views/charts2/charts/linkMonitor/LinkDirectionGrid/PopoverContent.vue +++ b/src/views/charts2/charts/linkMonitor/LinkDirectionGrid/PopoverContent.vue @@ -74,7 +74,7 @@