Przeglądaj źródła

fix(request): handle http 400 error

Lind 4 lat temu
rodzic
commit
c9aa3a6720

+ 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] });