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

@@ -81,7 +81,7 @@ import { getTypeCategory } from '@/views/charts/charts/tools'
import { urlParamsHandler, overwriteUrl, getDnsMapData, computeScore } from '@/utils/tools'
import ChartList from '@/views/charts2/ChartList'
import { useStore } from 'vuex'
import { get } from '@/utils/http'
import axios from 'axios'
export default {
name: 'Panel',
@@ -446,14 +446,14 @@ export default {
}
if ((type && condition) || type) {
params.type = params.type || type
get(url, params).then(res => {
if (res.code === 200) {
axios.get(url, { params }).then(res => {
if (res.status === 200) {
const data = {
establishLatencyMs: res.data.result.establishLatencyMsAvg || null,
httpResponseLatency: res.data.result.httpResponseLatencyAvg || null,
sslConLatency: res.data.result.sslConLatencyAvg || null,
tcpLostlenPercent: res.data.result.tcpLostlenPercentAvg || null,
pktRetransPercent: res.data.result.pktRetransPercentAvg || null
establishLatencyMs: res.data.data.result.establishLatencyMsAvg || null,
httpResponseLatency: res.data.data.result.httpResponseLatencyAvg || null,
sslConLatency: res.data.data.result.sslConLatencyAvg || null,
tcpLostlenPercent: res.data.data.result.tcpLostlenPercentAvg || null,
pktRetransPercent: res.data.data.result.pktRetransPercentAvg || null
}
this.score = computeScore(data)
}