CN-749 fix: 统一error交互

This commit is contained in:
刘洪洪
2023-03-22 10:20:22 +08:00
parent a8c8a8b6dc
commit 8dd50b9c99
18 changed files with 30 additions and 30 deletions

View File

@@ -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)
})