|
@@ -219,21 +219,19 @@ const handleAuthorized = () => {
|
|
if (!isRelogin.show) {
|
|
if (!isRelogin.show) {
|
|
isRelogin.show = true
|
|
isRelogin.show = true
|
|
ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), {
|
|
ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), {
|
|
|
|
+ showCancelButton: false,
|
|
|
|
+ closeOnClickModal: false,
|
|
|
|
+ showClose: false,
|
|
confirmButtonText: t('login.relogin'),
|
|
confirmButtonText: t('login.relogin'),
|
|
- cancelButtonText: t('common.cancel'),
|
|
|
|
type: 'warning'
|
|
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'))
|
|
return Promise.reject(t('sys.api.timeoutMessage'))
|
|
}
|
|
}
|