Przeglądaj źródła

fix: 提交代码设备接入

sun-chaochao 3 lat temu
rodzic
commit
2a1dbfc6a2
1 zmienionych plików z 10 dodań i 8 usunięć
  1. 10 8
      src/pages/rule-engine/Instance/index.tsx

+ 10 - 8
src/pages/rule-engine/Instance/index.tsx

@@ -224,14 +224,16 @@ const Instance = () => {
             disabled: record.state.value !== 'disable',
             onConfirm: async () => {
               if (record.state.value === 'disable') {
-                await service.remove(record.id);
-                message.success(
-                  intl.formatMessage({
-                    id: 'pages.data.option.success',
-                    defaultMessage: '操作成功!',
-                  }),
-                );
-                actionRef.current?.reload();
+                const resp: any = await service.remove(record.id);
+                if (resp.status === 200) {
+                  message.success(
+                    intl.formatMessage({
+                      id: 'pages.data.option.success',
+                      defaultMessage: '操作成功!',
+                    }),
+                  );
+                  actionRef.current?.reload();
+                }
               } else {
                 message.error('未停止不能删除');
               }