fix: 废弃http.js的封装请求方法

This commit is contained in:
chenjinsong
2023-08-25 10:18:20 +08:00
parent 7f91d75792
commit f4ba0040ea
33 changed files with 244 additions and 332 deletions

View File

@@ -68,7 +68,7 @@
<script>
import { api } from '@/utils/api'
import { getSecond } from '@/utils/date-util'
import { get } from '@/utils/http'
import axios from 'axios'
import chartMixin from '@/views/charts2/chart-mixin'
import ChartError from '@/components/common/Error'
@@ -150,19 +150,19 @@ export default {
limit: 10,
type: this.metric
}
get(api.npm.events.dimensionEvents, params).then(res => {
if (res.code === 200) {
axios.get(api.npm.events.dimensionEvents, { params }).then(res => {
if (res.status === 200) {
this.showError = false
if (!res.data.result || res.data.result.length === 0) {
if (!res.data.data.result || res.data.data.result.length === 0) {
this.isNoData = true
}
this.tableData = res.data.result
this.tableData = res.data.data.result
} else {
this.isNoData = false
this.showError = true
this.errorMsg = this.errorMsgHandler(res)
this.errorMsg = this.errorMsgHandler(res.data)
}
}).catch((e) => {
}).catch(e => {
this.isNoData = false
this.showError = true
this.errorMsg = this.errorMsgHandler(e)