Skip to content

Commit ba59859

Browse files
author
puhui999
committed
update: 解决点击遮罩层弹窗关闭后,页面就操作不了了会一直转圈的问题
1 parent ad16456 commit ba59859

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

build/vite/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import progress from 'vite-plugin-progress'
66
import EslintPlugin from 'vite-plugin-eslint'
77
import PurgeIcons from 'vite-plugin-purge-icons'
88
import { ViteEjsPlugin } from 'vite-plugin-ejs'
9+
// @ts-ignore
910
import ElementPlus from 'unplugin-element-plus/vite'
1011
import AutoImport from 'unplugin-auto-import/vite'
1112
import Components from 'unplugin-vue-components/vite'

src/config/axios/service.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,19 @@ const handleAuthorized = () => {
219219
if (!isRelogin.show) {
220220
isRelogin.show = true
221221
ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), {
222+
showCancelButton: false,
223+
closeOnClickModal: false,
224+
showClose: false,
222225
confirmButtonText: t('login.relogin'),
223-
cancelButtonText: t('common.cancel'),
224226
type: 'warning'
227+
}).then(() => {
228+
const { wsCache } = useCache()
229+
resetRouter() // 重置静态路由表
230+
wsCache.clear()
231+
removeToken()
232+
isRelogin.show = false
233+
window.location.href = '/'
225234
})
226-
.then(() => {
227-
const { wsCache } = useCache()
228-
resetRouter() // 重置静态路由表
229-
wsCache.clear()
230-
removeToken()
231-
isRelogin.show = false
232-
window.location.href = '/'
233-
})
234-
.catch(() => {
235-
isRelogin.show = false
236-
})
237235
}
238236
return Promise.reject(t('sys.api.timeoutMessage'))
239237
}

0 commit comments

Comments
 (0)