|
@@ -4,6 +4,7 @@ import axios from 'axios'
|
|
|
import { loginUrl } from '@/apiConfig/requestIP.js'
|
|
|
import { Encrypt } from '@/utils/crypto-js.js'
|
|
|
import { message } from '@/utils/mesDebounce'
|
|
|
+import router from '@/router/index.js'
|
|
|
|
|
|
// create an axios instance
|
|
|
const service = axios.create({
|
|
@@ -115,6 +116,8 @@ service.interceptors.response.use(
|
|
|
})
|
|
|
if (error.response.status === 401) {
|
|
|
location.href = loginUrl
|
|
|
+ } else if (error.response.status === 403) {
|
|
|
+ router.push({ name: 'notAccess' })
|
|
|
}
|
|
|
} else {
|
|
|
error.message = '网络请求超时,请检查网络信息!'
|