[update 网络请求] wp29和iso接口挂了就不提示报错

This commit is contained in:
danshihao
2024-06-18 10:21:02 +08:00
parent 3aab024209
commit 1f0e17bfdb
+8 -2
View File
@@ -20,6 +20,12 @@ const err = (error) => {
const token = Vue.ls.get(ACCESS_TOKEN)
// console.log('------异常响应------', token)
// console.log('------异常响应------', error.response.status)
// 如果ISO和WP29挂了,就不提示
let tipFlag = true
if(error.config.url.indexOf('/WPApi') === 0 || error.config.url.indexOf('/ISO') === 0) {
tipFlag = false
}
switch (error.response.status) {
case 403:
notification.error({ message: '系统提示', description: '拒绝访问', duration: 4 })
@@ -60,7 +66,7 @@ const err = (error) => {
}
break
case 404:
notification.error({ message: '系统提示', description: '很抱歉,资源未找到!', duration: 4 })
tipFlag && notification.error({ message: '系统提示', description: '很抱歉,资源未找到!', duration: 4 })
break
case 504:
notification.error({ message: '系统提示', description: '网络超时' })
@@ -76,7 +82,7 @@ const err = (error) => {
}
break
default:
notification.error({
tipFlag && notification.error({
message: '系统提示',
description: data.message,
duration: 4