From da8a573b303bb7a2af9a0b57db45650efa4a2b7c Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Mon, 13 Jan 2020 09:07:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD=201.p?= =?UTF-8?q?anel=E5=88=9B=E5=BB=BA=E5=9B=BE=E8=A1=A8=E6=97=B6metric?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=B8=8B=E6=8B=89=E6=A1=86=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=20fix:=E4=BF=AE=E6=94=B9BU?= =?UTF-8?q?G=201.panel=E5=9B=BE=E8=A1=A8=E5=B1=95=E7=A4=BAnetwork=20error?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8D=95=E8=8E=B7=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-list.vue | 8 +++++++- .../src/components/page/dashboard/chartMetric.vue | 3 ++- nezha-fronted/src/http.js | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 5e8271314..90647fa41 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -228,6 +228,12 @@ export default { } }); } + }else{ + if(response.msg){ + this.$message.error(response.msg); + }else { + this.$message.error(response); + } } }); // chartData, seriesItem, panelsId, filter @@ -253,7 +259,7 @@ export default { } }).catch((error) => { if (error) { - this.$message.warning({ + this.$message.error({ content: this.$t("tip.refreshLater"),//'Please refesh later',//请稍后刷新 duration: 3, }); diff --git a/nezha-fronted/src/components/page/dashboard/chartMetric.vue b/nezha-fronted/src/components/page/dashboard/chartMetric.vue index 592494c14..8f5900ea0 100644 --- a/nezha-fronted/src/components/page/dashboard/chartMetric.vue +++ b/nezha-fronted/src/components/page/dashboard/chartMetric.vue @@ -96,7 +96,7 @@ - + {{item.metric}} @@ -133,6 +133,7 @@ {{op}} diff --git a/nezha-fronted/src/http.js b/nezha-fronted/src/http.js index 0ee8a11e9..0f55bf2a5 100644 --- a/nezha-fronted/src/http.js +++ b/nezha-fronted/src/http.js @@ -42,7 +42,11 @@ export function get(url, params) { }).then(response => { resolve(response.data) }).catch(err => { - //resolve(err.response.data) + if(err.response){ + resolve(err.response.data); + }else if(err.message){ + resolve(err.message); + } }) }) }