diff --git a/src/utils/request.ts b/src/utils/request.ts index f6b2d6ed..54687a0d 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -167,7 +167,11 @@ const errorHandler = (error: any) => { showNotification(error?.code, error?.response?.data?.message, '404') } } else if (error.response === undefined) { - showNotification(error.message, (error.stack + '').substr(0, 90), undefined) + if (error.message.includes('timeout')) { + showNotification(error.message, '接口响应超时', undefined) + } else { + showNotification(error.message, (error.stack + '').substr(0, 90), undefined) + } } return Promise.reject(error) } diff --git a/src/views/device/Product/Detail/DeviceAccess/index.vue b/src/views/device/Product/Detail/DeviceAccess/index.vue index fd0e1672..6f4ebf47 100644 --- a/src/views/device/Product/Detail/DeviceAccess/index.vue +++ b/src/views/device/Product/Detail/DeviceAccess/index.vue @@ -686,7 +686,7 @@ const getData = async (accessId?: string) => { productTypes.value = resp.result.map(item => { if (pluginRes?.result?.externalId === item.id) { productData.id = pluginRes?.result?.externalId - productData.metadata = JSON.stringify(item.metadata || {}) + productData.metadata = item.metadata } return { ...item, label: item.name, value: item.id } }) @@ -724,7 +724,20 @@ const submitDevice = async () => { const id = productStore.current?.id; // 该产品是否有物模型,有则弹窗进行处理 const _metadata = JSON.parse(productStore.current?.metadata || '{}') - if (_metadata.properties?.length || _metadata.events?.length || _metadata.functions?.length || _metadata.tags?.length) { + console.log(_metadata.properties, productData.metadata) + if ( + (_metadata.properties?.length || + _metadata.events?.length || + _metadata.functions?.length || + _metadata.tags?.length + ) && + ( + productData.metadata?.properties?.length || + productData.metadata?.events?.length || + productData.metadata?.functions?.length || + productData.metadata?.tags?.length + ) + ) { metadataModalCacheData.value = { id, values, diff --git a/src/views/system/Menu/Setting/index.vue b/src/views/system/Menu/Setting/index.vue index cad1e29d..c26096f3 100644 --- a/src/views/system/Menu/Setting/index.vue +++ b/src/views/system/Menu/Setting/index.vue @@ -10,30 +10,31 @@