From 88777c12a27cf4f9ec455a9aa501d91733e84088 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Wed, 7 Jun 2023 17:44:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20dns=20dashboard=E7=9A=84qtype=E5=92=8Crc?= =?UTF-8?q?ode=E7=B1=BB=E5=9E=8B=E4=B8=8B=E9=92=BB=E5=90=8E=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E5=9B=9B=E7=BA=A7=E9=9D=A2=E5=8C=85=E5=B1=91=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=90=8E=E6=98=BE=E7=A4=BA=E6=95=B0=E5=AD=97=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/Header.vue | 6 +++--- src/views/detections/Index.vue | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/layout/Header.vue b/src/components/layout/Header.vue index 7e70a9db..fc55f932 100644 --- a/src/components/layout/Header.vue +++ b/src/components/layout/Header.vue @@ -545,13 +545,13 @@ export default { changeValue (value) { // 设置面包屑显示的内容及hover时的title let valName = value - if (this.tab === 'qtype') { + if (this.curTabProp === 'qtype') { valName = this.dnsQtypeMapData.get(value) - } else if (this.tab === 'rcode') { + } else if (this.curTabProp === 'rcode') { valName = this.dnsRcodeMapData.get(value) } this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null - document.getElementById('breadcrumbValue').innerText = value + document.getElementById('breadcrumbValue').innerText = valName document.getElementById(this.valueMenuId).setAttribute('title', valName) document.getElementById('breadcrumbButton').click() const columnName = this.getUrlParam(this.curTabState.thirdMenu, '') diff --git a/src/views/detections/Index.vue b/src/views/detections/Index.vue index 78fb4962..156e109b 100644 --- a/src/views/detections/Index.vue +++ b/src/views/detections/Index.vue @@ -135,6 +135,7 @@ import { pieForSeverity } from '@/views/detections/options/detectionOptions' import { api, getData } from '@/utils/api' +import { get } from '@/utils/http' import { extensionEchartY, reverseSortBy } from '@/utils/tools' import { useRoute } from 'vue-router' import Loading from '@/components/common/Loading' @@ -609,10 +610,14 @@ export default { pageSize: this.pageObj.pageSize, pageNo: this.pageObj.pageNo } - getData(api.detection[this.pageType].listBasic, params).then(data => { - this.listData = data - }).catch(error => { - console.log(error) + get(api.detection[this.pageType].listBasic, params).then(response => { + if (response.code === 200) { + this.listData = response.data + } else { + this.listData = [] + console.error(response.message) + this.$message.error(response.message) + } }) getData(api.detection[this.pageType].listCount, params).then(data => { this.pageObj.total = data