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')) }