From ba5985943bad95d977d5753ca6a6d26a77e12429 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 30 Mar 2023 16:04:46 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=A7=A3=E5=86=B3=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=81=AE=E7=BD=A9=E5=B1=82=E5=BC=B9=E7=AA=97=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E9=A1=B5=E9=9D=A2=E5=B0=B1=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E4=B8=8D=E4=BA=86=E4=BA=86=E4=BC=9A=E4=B8=80=E7=9B=B4=E8=BD=AC?= =?UTF-8?q?=E5=9C=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vite/index.ts | 1 + src/config/axios/service.ts | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build/vite/index.ts b/build/vite/index.ts index dcec1aed..fa7e04e8 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -6,6 +6,7 @@ import progress from 'vite-plugin-progress' import EslintPlugin from 'vite-plugin-eslint' import PurgeIcons from 'vite-plugin-purge-icons' import { ViteEjsPlugin } from 'vite-plugin-ejs' +// @ts-ignore import ElementPlus from 'unplugin-element-plus/vite' import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 7109615b..afe75d8a 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -219,21 +219,19 @@ const handleAuthorized = () => { if (!isRelogin.show) { isRelogin.show = true ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { + showCancelButton: false, + closeOnClickModal: false, + showClose: false, confirmButtonText: t('login.relogin'), - cancelButtonText: t('common.cancel'), type: 'warning' + }).then(() => { + const { wsCache } = useCache() + resetRouter() // 重置静态路由表 + wsCache.clear() + removeToken() + isRelogin.show = false + window.location.href = '/' }) - .then(() => { - const { wsCache } = useCache() - resetRouter() // 重置静态路由表 - wsCache.clear() - removeToken() - isRelogin.show = false - window.location.href = '/' - }) - .catch(() => { - isRelogin.show = false - }) } return Promise.reject(t('sys.api.timeoutMessage')) }