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

@@ -99,8 +99,9 @@
<script>
import GeneralSettings from '@/components/table/detection/GeneralSettings'
import RuleDefinition from '@/components/table/detection/RuleDefinition'
import { get } from '@/utils/http'
import { api } from '@/utils/api'
import axios from 'axios'
import _ from 'lodash'
export default {
name: 'DetectionForm',
@@ -160,11 +161,11 @@ export default {
methods: {
/** 获取下拉列表数据 */
getStatistics () {
get(api.detection.statistics, { pageSize: -1 }).then(response => {
if (response.code === 200) {
this.intervalList = response.data.intervalList || []
axios.get(api.detection.statistics, { pageSize: -1 }).then(response => {
if (response.status === 200) {
this.intervalList = _.get(response, 'data.data.intervalList', [])
} else {
console.error(response)
console.error(response.data)
}
}).finally(() => {
})