|
@@ -5,6 +5,7 @@ import store from '@/store'
|
|
import { startLoading, endLoading } from './loading'
|
|
import { startLoading, endLoading } from './loading'
|
|
|
|
|
|
const apiUrl = import.meta.env.VITE_BASE_URL
|
|
const apiUrl = import.meta.env.VITE_BASE_URL
|
|
|
|
+let loginBox = null
|
|
|
|
|
|
const service = axios.create({
|
|
const service = axios.create({
|
|
baseURL: apiUrl,
|
|
baseURL: apiUrl,
|
|
@@ -77,12 +78,16 @@ service.interceptors.response.use(
|
|
}).then(() => {})
|
|
}).then(() => {})
|
|
}
|
|
}
|
|
} else if (response.data.code > 3000 && response.data.code < 4000) {
|
|
} else if (response.data.code > 3000 && response.data.code < 4000) {
|
|
- ElMessageBox.alert(response.data.message, '提示', {
|
|
|
|
- type: 'warning',
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- }).then(() => {
|
|
|
|
- router.push('/login')
|
|
|
|
- })
|
|
|
|
|
|
+ if (loginBox === null) {
|
|
|
|
+ loginBox = ElMessageBox.alert(response.data.message, '提示', {
|
|
|
|
+ type: 'warning',
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ showClose: false,
|
|
|
|
+ }).then(() => {
|
|
|
|
+ loginBox = null
|
|
|
|
+ router.push('/login')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (response.data.data) {
|
|
if (response.data.data) {
|
|
return Promise.reject(response.data)
|
|
return Promise.reject(response.data)
|