CN-749 fix: 统一error交互
This commit is contained in:
@@ -178,13 +178,13 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(res.message)
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(e.message)
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
}).finally(() => {
|
||||
this.toggleLoading(false)
|
||||
})
|
||||
|
||||
@@ -248,7 +248,7 @@ export default {
|
||||
} else {
|
||||
this.linkNoData = false
|
||||
this.showError1 = true
|
||||
this.errorMsg1 = res[0].message
|
||||
this.errorMsg1 = this.errorMsgHandler(res[0])
|
||||
}
|
||||
|
||||
if (res[1].code === 200) {
|
||||
@@ -311,7 +311,7 @@ export default {
|
||||
} else {
|
||||
this.showError2 = true
|
||||
this.nextHopNoData = false
|
||||
this.errorMsg2 = res[1].message
|
||||
this.errorMsg2 = this.errorMsgHandler(res[1])
|
||||
}
|
||||
}
|
||||
}).catch(e => {
|
||||
|
||||
@@ -143,7 +143,7 @@ export default {
|
||||
} else {
|
||||
this.isLinkNoData = false
|
||||
this.isLinkShowError = true
|
||||
this.linkErrorMsg = res[0].message
|
||||
this.linkErrorMsg = this.errorMsgHandler(res[0])
|
||||
}
|
||||
|
||||
if (res[1].code === 200) {
|
||||
@@ -232,7 +232,7 @@ export default {
|
||||
} else {
|
||||
this.isNextNoData = false
|
||||
this.isNextShowError = true
|
||||
this.nextErrorMsg = res[1].message
|
||||
this.nextErrorMsg = this.errorMsgHandler(res[1])
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
|
||||
@@ -176,12 +176,12 @@ export default {
|
||||
}
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(res.message)
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(e.message)
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
this.isNoData = false
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
this.dataProcessing(res.data.result, parseInt(n))
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
|
||||
@@ -288,7 +288,7 @@ export default {
|
||||
})
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = res[0].message
|
||||
this.errorMsg = this.errorMsgHandler(res[0])
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
this.toggleLoading(true)
|
||||
axios.get(api.netWorkOverview.totalTrafficAnalysis, { params: params }).then(response => {
|
||||
const res = response.data
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
|
||||
if (res.code === 200) {
|
||||
this.isNoData = res.data.result.length === 0
|
||||
@@ -186,13 +186,13 @@ export default {
|
||||
}
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(res.message)
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(e.message)
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
}).finally(() => {
|
||||
this.toggleLoading(false)
|
||||
})
|
||||
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError1 = true
|
||||
this.errorMsg1 = res.data.message
|
||||
this.errorMsg1 = this.errorMsgHandler(res.data.message)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
@@ -148,7 +148,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData2 = false
|
||||
this.showError2 = true
|
||||
this.errorMsg2 = res.message
|
||||
this.errorMsg2 = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
this.isNoData2 = false
|
||||
|
||||
@@ -160,7 +160,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.isNoData = false
|
||||
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
this.isNoData = false
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
})
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
this.showError = true
|
||||
|
||||
@@ -122,7 +122,7 @@ export default {
|
||||
})
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = r.message
|
||||
this.errorMsg = this.errorMsgHandler(r)
|
||||
}
|
||||
})
|
||||
mapData.forEach(t => {
|
||||
@@ -146,14 +146,14 @@ export default {
|
||||
}
|
||||
}).catch(e => {
|
||||
this.showError = true
|
||||
this.errorMsg = e.message
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
}).finally(() => {
|
||||
this.toggleLoading(false)
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
this.showError = true
|
||||
this.errorMsg = e.message
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
}
|
||||
},
|
||||
loadMarkerData (imageSeries, data) {
|
||||
|
||||
@@ -153,7 +153,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(res.message)
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
|
||||
@@ -171,7 +171,7 @@ export default {
|
||||
this.loadMarkerData(imageSeries, mapData)
|
||||
}).catch((e) => {
|
||||
this.showError = true
|
||||
this.errorMsg = e.message
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
})
|
||||
} else {
|
||||
imageSeries.data = [{}]
|
||||
@@ -185,7 +185,7 @@ export default {
|
||||
} catch (e) {
|
||||
this.showError = true
|
||||
// todo 此处错误信息有待考证,后续可能会改动
|
||||
this.errorMsg = e
|
||||
this.errorMsg = this.errorMsgHandler(e)
|
||||
console.error(e)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
this.isNoData = false
|
||||
|
||||
@@ -176,7 +176,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(res.message)
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
}).catch(e => {
|
||||
this.isNoData = false
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
} else {
|
||||
this.isNoData = false
|
||||
this.showError = true
|
||||
this.errorMsg = this.errorMsgHandler(res.message)
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
}
|
||||
})
|
||||
this.showError = false
|
||||
|
||||
@@ -111,12 +111,12 @@ export default {
|
||||
}
|
||||
} else {
|
||||
this.showError = true
|
||||
this.errorMsg = res.message
|
||||
this.errorMsg = this.errorMsgHandler(res)
|
||||
this.changeByErrorOrNodata()
|
||||
}
|
||||
}).catch(error => {
|
||||
this.showError = true
|
||||
this.errorMsg = error.message
|
||||
this.errorMsg = this.errorMsgHandler(error)
|
||||
this.changeByErrorOrNodata()
|
||||
}).finally(() => {
|
||||
this.toggleLoading(false)
|
||||
|
||||
Reference in New Issue
Block a user