fix: 增加通讯异常catch

This commit is contained in:
wangshuaiswim 2023-03-22 14:33:12 +08:00
parent f495834dd5
commit b0e5654ad1
1 changed files with 3 additions and 3 deletions

View File

@ -206,14 +206,14 @@ const handleImport = async () => {
loading.value = true loading.value = true
const { id } = route.params || {} const { id } = route.params || {}
if (data.metadata === 'alink') { if (data.metadata === 'alink') {
const res = await convertMetadata('from', 'alink', data.import) const res = await convertMetadata('from', 'alink', data.import).catch(err => err)
if (res.status === 200) { if (res.status === 200) {
const metadata = operateLimits(res.result) const metadata = operateLimits(res.result)
if (props?.type === 'device') { if (props?.type === 'device') {
await saveMetadata(id as string, metadata) await saveMetadata(id as string, metadata).catch(err => err)
// instanceStore.setCurrent(JSON.parse(metadata || '{}')) // instanceStore.setCurrent(JSON.parse(metadata || '{}'))
} else { } else {
await modify(id as string, { metadata: metadata }) await modify(id as string, { metadata: metadata }).catch(err => err)
// productStore.setCurrent(JSON.parse(metadata || '{}')) // productStore.setCurrent(JSON.parse(metadata || '{}'))
} }
loading.value = false loading.value = false