[update 网络请求] wp29和iso接口挂了就不提示报错
This commit is contained in:
@@ -20,6 +20,12 @@ const err = (error) => {
|
|||||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||||
// console.log('------异常响应------', token)
|
// console.log('------异常响应------', token)
|
||||||
// console.log('------异常响应------', error.response.status)
|
// 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) {
|
switch (error.response.status) {
|
||||||
case 403:
|
case 403:
|
||||||
notification.error({ message: '系统提示', description: '拒绝访问', duration: 4 })
|
notification.error({ message: '系统提示', description: '拒绝访问', duration: 4 })
|
||||||
@@ -60,7 +66,7 @@ const err = (error) => {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 404:
|
case 404:
|
||||||
notification.error({ message: '系统提示', description: '很抱歉,资源未找到!', duration: 4 })
|
tipFlag && notification.error({ message: '系统提示', description: '很抱歉,资源未找到!', duration: 4 })
|
||||||
break
|
break
|
||||||
case 504:
|
case 504:
|
||||||
notification.error({ message: '系统提示', description: '网络超时' })
|
notification.error({ message: '系统提示', description: '网络超时' })
|
||||||
@@ -76,7 +82,7 @@ const err = (error) => {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
notification.error({
|
tipFlag && notification.error({
|
||||||
message: '系统提示',
|
message: '系统提示',
|
||||||
description: data.message,
|
description: data.message,
|
||||||
duration: 4
|
duration: 4
|
||||||
|
|||||||
Reference in New Issue
Block a user