From ec2982636530e3626c48011edb1d03efff7dcf8b Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 28 Dec 2021 15:14:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20token=20=E8=BF=87=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E4=BC=A0=20excel=20=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E7=99=BB=E9=99=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/AsyncComponent/index.vue | 2 +- frontend/src/views/dataset/add/AddExcel.vue | 16 ++++++++++++++++ frontend/src/views/system/plugin/PluginCom.vue | 10 ++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/AsyncComponent/index.vue b/frontend/src/components/AsyncComponent/index.vue index 677f1dd5e2..09dd19ef4c 100644 --- a/frontend/src/components/AsyncComponent/index.vue +++ b/frontend/src/components/AsyncComponent/index.vue @@ -22,7 +22,7 @@ export default { }, obj: { type: Object, - default: {} + default: () => {} } }, data() { diff --git a/frontend/src/views/dataset/add/AddExcel.vue b/frontend/src/views/dataset/add/AddExcel.vue index 340821ebb3..a3b7236f0d 100644 --- a/frontend/src/views/dataset/add/AddExcel.vue +++ b/frontend/src/views/dataset/add/AddExcel.vue @@ -153,6 +153,8 @@ import { post } from '@/api/dataset/dataset' import { getToken } from '@/utils/auth' import i18n from '@/lang' +import {$alert} from "@/utils/message"; +import store from "@/store"; const token = getToken() @@ -263,6 +265,20 @@ export default { uploadFail(response, file, fileList) { let myError = response.toString() myError = myError.replace('Error: ', '') + + if(myError.indexOf('AuthenticationException') >= 0){ + const message = i18n.t('login.tokenError') + $alert(message, () => { + store.dispatch('user/logout').then(() => { + location.reload() + }) + }, { + confirmButtonText: i18n.t('login.re_login'), + showClose: false + }) + return + } + const errorMessage = JSON.parse(myError).message + ', ' + this.$t('dataset.parse_error') this.path = '' diff --git a/frontend/src/views/system/plugin/PluginCom.vue b/frontend/src/views/system/plugin/PluginCom.vue index 2f6d3b3faa..7a7767b33b 100644 --- a/frontend/src/views/system/plugin/PluginCom.vue +++ b/frontend/src/views/system/plugin/PluginCom.vue @@ -1,6 +1,7 @@