fix: 请求成功的判断条件code改为status(部分)

This commit is contained in:
chenjinsong
2023-08-24 17:15:41 +08:00
parent 7b0ec06a05
commit 21f32dfdda
75 changed files with 422 additions and 5595 deletions

View File

@@ -156,9 +156,9 @@ export default {
this.toggleLoading(true)
if (params.type && params.q) {
axios.get(api.npm.overview.trafficGraph, { params: params }).then(res => {
res = res.data
if (res.code === 200) {
axios.get(api.npm.overview.trafficGraph, { params: params }).then(response => {
const res = response.data
if (response.status === 200) {
this.showError = false
this.isNoData = res.data.result.length === 0
if (this.isNoData) {
@@ -185,7 +185,7 @@ export default {
const npmLineData = []
Promise.all([totalNetworkAnalysis, totalTrafficAnalysis, totalHttpResponseDelay, totalSslConDelay]).then(res => {
res.forEach(item => {
if (item.data.code === 200) {
if (item.status === 200) {
npmLineData.push(...item.data.data.result)
} else {
this.httpError(res)