From 4e540b022dbdf51af5ee015863cc0b591683602e Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Thu, 30 Mar 2023 18:24:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B5=84=E6=BA=90=E5=BA=93=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/instance.ts | 7 ++++++- src/views/device/Instance/Detail/index.vue | 1 + src/views/edge/Device/index.vue | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/store/instance.ts b/src/store/instance.ts index 5d617ae2..92e06b47 100644 --- a/src/store/instance.ts +++ b/src/store/instance.ts @@ -1,6 +1,7 @@ import { DeviceInstance, InstanceModel } from "@/views/device/Instance/typings" import { defineStore } from "pinia" import { detail } from '@/api/device/instance' +import { onlyMessage } from "@/utils/comm" export const useInstanceStore = defineStore({ id: 'device', @@ -15,10 +16,14 @@ export const useInstanceStore = defineStore({ this.detail = current }, async refresh(id: string) { - const resp = await detail(id) + const resp: any = await detail(id).catch((err) => { + onlyMessage(err.response.data.message, 'error') + }) if(resp.status === 200){ this.current = resp.result this.detail = resp.result + } else { + onlyMessage(resp?.message, 'error') } }, setTabActiveKey(key: string) { diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue index 7cadf19e..5b41c6f6 100644 --- a/src/views/device/Instance/Detail/index.vue +++ b/src/views/device/Instance/Detail/index.vue @@ -328,6 +328,7 @@ const jumpProduct = () => { }; onUnmounted(() => { + instanceStore.current = {} as any statusRef.value && statusRef.value.unsubscribe(); }); diff --git a/src/views/edge/Device/index.vue b/src/views/edge/Device/index.vue index 38315647..8aae7440 100644 --- a/src/views/edge/Device/index.vue +++ b/src/views/edge/Device/index.vue @@ -51,7 +51,9 @@ >