From 74c0b9fc0a7e8a0c4e70464048bafeb1f02a3e2b Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Fri, 31 Mar 2023 10:42:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/instance.ts | 6 +- src/utils/request.ts | 2 + src/views/edge/Device/index.vue | 153 +++++++++++++++++++++----------- yarn.lock | 4 +- 4 files changed, 108 insertions(+), 57 deletions(-) diff --git a/src/store/instance.ts b/src/store/instance.ts index 92e06b47..63c49e0a 100644 --- a/src/store/instance.ts +++ b/src/store/instance.ts @@ -16,14 +16,10 @@ export const useInstanceStore = defineStore({ this.detail = current }, async refresh(id: string) { - const resp: any = await detail(id).catch((err) => { - onlyMessage(err.response.data.message, 'error') - }) + const resp: any = await detail(id) if(resp.status === 200){ this.current = resp.result this.detail = resp.result - } else { - onlyMessage(resp?.message, 'error') } }, setTabActiveKey(key: string) { diff --git a/src/utils/request.ts b/src/utils/request.ts index 2b8d2cb7..2760425b 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -151,6 +151,8 @@ const errorHandler = (error: any) => { path: LoginPath }) }, 0) + } else if (status === 404) { + showNotification(error?.code, error?.response?.data?.message, '404') } } else if (error.response === undefined) { showNotification(error.message, (error.stack + '').substr(0, 90), undefined) diff --git a/src/views/edge/Device/index.vue b/src/views/edge/Device/index.vue index 8aae7440..6545579f 100644 --- a/src/views/edge/Device/index.vue +++ b/src/views/edge/Device/index.vue @@ -53,7 +53,8 @@ @@ -85,8 +86,42 @@