|
@@ -5,6 +5,7 @@ import {useRequestLoading} from '@/hooks/useRequestLoading'
|
|
|
import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
import CryptoJS from '@/utils/crypto'
|
|
|
import {useToken} from '@/hooks/useToken'
|
|
|
+import {$confirmDialog} from '@/plugin/dialog'
|
|
|
|
|
|
const {token}=useToken()
|
|
|
|
|
@@ -19,6 +20,7 @@ const LOADINGWHITELIST=[]
|
|
|
let LOADINGCOUNT = 0;
|
|
|
let LOADING;
|
|
|
const {isLoading,startLoading,closeLoading}=useRequestLoading()
|
|
|
+let NOLOGINCOUNT=0 //为登录提示次数
|
|
|
|
|
|
let config = {
|
|
|
baseURL: import.meta.env.VITE_APP_API_URL,
|
|
@@ -79,8 +81,19 @@ _axios.interceptors.response.use(
|
|
|
}, 100);
|
|
|
}
|
|
|
if(data.Ret===408){//token失效
|
|
|
- MessagePlugin.error(data.Msg)
|
|
|
- router.replace('/login')
|
|
|
+ if(NOLOGINCOUNT===0){
|
|
|
+ $confirmDialog({
|
|
|
+ header:'提示',
|
|
|
+ body: data.Msg,
|
|
|
+ confirmBtn:'去登录',
|
|
|
+ cancelBtn:null,
|
|
|
+ closeBtn:false
|
|
|
+ }).then(()=>{
|
|
|
+ NOLOGINCOUNT=0
|
|
|
+ router.replace('/login')
|
|
|
+ });
|
|
|
+ }
|
|
|
+ NOLOGINCOUNT++
|
|
|
}
|
|
|
if(data.Ret===403){
|
|
|
setTimeout(() => {
|