Преглед на файлове

fix(request): handle http 400 error

Lind преди 4 години
родител
ревизия
c9aa3a6720
променени са 2 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 1 0
      src/pages/device/Product/Detail/Metadata/Cat/index.tsx
  2. 3 0
      src/pages/device/Product/Detail/Metadata/Import/index.tsx

+ 1 - 0
src/pages/device/Product/Detail/Metadata/Cat/index.tsx

@@ -22,6 +22,7 @@ const Cat = (props: Props) => {
 
   const convertMetadata = (key: string) => {
     if (key === 'alink') {
+      setValue('');
       service.convertMetadata('to', 'alink', JSON.parse(metadata)).subscribe({
         next: (data) => {
           setValue(JSON.stringify(data));

+ 3 - 0
src/pages/device/Product/Detail/Metadata/Import/index.tsx

@@ -172,6 +172,9 @@ const Import = (props: Props) => {
         next: async (meta) => {
           await service.modify(param.id, { metadata: JSON.stringify(meta) });
         },
+        error: () => {
+          message.error('发生错误!');
+        },
       });
     } else {
       await service.modify(param.id, { metadata: data[data.type] });