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

@@ -215,7 +215,7 @@ import { unitTypes } from '@/utils/constants'
import { valueToRangeValue } from '@/utils/unit-convert'
import Chart from '@/views/charts/Chart'
import _ from 'lodash'
import { get } from '@/utils/http'
import axios from 'axios'
import relatedServer from '@/mixins/relatedServer'
import { dateFormatByAppearance, getMillisecond } from '@/utils/date-util'
import Loading from '@/components/common/Loading'
@@ -336,9 +336,9 @@ export default {
},
chartGetMap () {
this.loadingMap = true
get((this.trafficUrlMap), this.getQueryParams()).then(response => {
if (response.code === 200) {
this.chartData = response.data.result
axios.get(this.trafficUrlMap, { params: this.getQueryParams() }).then(response => {
if (response.status === 200) {
this.chartData = response.data.data.result
}
this.loadingMap = false
})

View File

@@ -219,7 +219,7 @@ import { unitTypes } from '@/utils/constants'
import { valueToRangeValue } from '@/utils/unit-convert'
import Chart from '@/views/charts/Chart'
import _ from 'lodash'
import { get } from '@/utils/http'
import axios from 'axios'
import relatedServer from '@/mixins/relatedServer'
import { dateFormatByAppearance, getMillisecond } from '@/utils/date-util'
import Loading from '@/components/common/Loading'
@@ -341,26 +341,26 @@ export default {
},
chartGetMap () {
this.loadingMap = true
get(this.trafficUrlMap, this.getQueryParams()).then(response => {
if (response.code === 200) {
this.chartData = response.data.result
axios.get(this.trafficUrlMap, { params: this.getQueryParams() }).then(response => {
if (response.status === 200) {
this.chartData = response.data.data.result
}
this.loadingMap = false
})
},
getBasicProperties () {
get(this.basicProperties, this.getQueryParams()).then(response => {
if (response.code === 200) {
axios.get(this.basicProperties, { params: this.getQueryParams() }).then(response => {
if (response.status === 200) {
this.entityData = {
...this.entityData,
domainCategory: response.data.result.domainCategory,
domainCategoryGroup: response.data.result.domainCategoryGroup,
domainDescription: response.data.result.domainDescription,
domainReputationScore: response.data.result.domainReputationScore,
domainWhoisAddress: response.data.result.domainWhoisAddress,
domainWhoisOrg: response.data.result.domainWhoisOrg,
domainIcpCompanyName: response.data.result.domainIcpCompanyName,
domainIcpSiteLicense: response.data.result.domainIcpSiteLicense
domainCategory: response.data.data.result.domainCategory,
domainCategoryGroup: response.data.data.result.domainCategoryGroup,
domainDescription: response.data.data.result.domainDescription,
domainReputationScore: response.data.data.result.domainReputationScore,
domainWhoisAddress: response.data.data.result.domainWhoisAddress,
domainWhoisOrg: response.data.data.result.domainWhoisOrg,
domainIcpCompanyName: response.data.data.result.domainIcpCompanyName,
domainIcpSiteLicense: response.data.data.result.domainIcpSiteLicense
}
}
})

View File

@@ -252,7 +252,6 @@ import { unitTypes, countryNameIdMapping } from '@/utils/constants'
import { valueToRangeValue } from '@/utils/unit-convert'
import Chart from '@/views/charts/Chart'
import _ from 'lodash'
import { get } from '@/utils/http'
import relatedServer from '@/mixins/relatedServer'
import { dateFormatByAppearance, getMillisecond, getSecond } from '@/utils/date-util'
import Loading from '@/components/common/Loading'
@@ -422,9 +421,9 @@ export default {
},
chartGetMap () {
this.loadingMap = true
get((this.trafficUrlMap), this.getQueryParams()).then(response => {
if (response.code === 200) {
this.chartData = response.data.result
axios.get(this.trafficUrlMap, { params: this.getQueryParams() }).then(response => {
if (response.status === 200) {
this.chartData = response.data.data.result
}
this.loadingMap = false
})
@@ -441,7 +440,7 @@ export default {
}
axios.get(api.entity.entityList.ipRelatedPort, { params: params }).then(res => {
if (res.data.code === 200 && res.data.data.result.length) {
if (res.status === 200 && res.data.data.result.length) {
this.openPort = ''
res.data.data.result.forEach(item => {
this.openPort += item.port + '/' + item.l7Protocol + ','
@@ -485,11 +484,6 @@ export default {
</script>
<style lang="scss">
//.type-content {
// margin-bottom:15px;
// display:flex;
// flex-flow: row wrap;
// width:100%;
.data-item {
display: flex;
justify-content: center;