Przeglądaj źródła

perf: 运营设置-数据刷新逻辑

QuentinHsu 1 rok temu
rodzic
commit
65ae70919b

+ 2 - 2
web/src/pages/Setting/Operation/SettingsCreditLimit.js

@@ -40,16 +40,16 @@ export default function SettingsCreditLimit(props) {
         if (requestQueue.length === 1) {
           if (res.includes(undefined)) return;
         } else if (requestQueue.length > 1) {
-          if (res.includes(undefined)) return showError('部分更新失败');
+          if (res.includes(undefined)) return showError('部分更新失败,请重试');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }
 

+ 1 - 1
web/src/pages/Setting/Operation/SettingsDataDashboard.js

@@ -47,13 +47,13 @@ export default function DataDashboard(props) {
           if (res.includes(undefined)) return showError('部分更新失败');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }
 

+ 1 - 1
web/src/pages/Setting/Operation/SettingsDrawing.js

@@ -44,13 +44,13 @@ export default function SettingsDrawing(props) {
           if (res.includes(undefined)) return showError('部分更新失败');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }
 

+ 1 - 1
web/src/pages/Setting/Operation/SettingsGeneral.js

@@ -50,13 +50,13 @@ export default function GeneralSettings(props) {
           if (res.includes(undefined)) return showError('部分更新失败');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }
 

+ 1 - 1
web/src/pages/Setting/Operation/SettingsLog.js

@@ -46,13 +46,13 @@ export default function SettingsLog(props) {
           if (res.includes(undefined)) return showError('部分更新失败');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }
   async function onCleanHistoryLog() {

+ 1 - 1
web/src/pages/Setting/Operation/SettingsMagnification.js

@@ -46,13 +46,13 @@ export default function SettingsMagnification(props) {
             if (res.includes(undefined)) return showError('部分更新失败');
           }
           showSuccess('更新成功');
+          props.refresh();
         })
         .catch(() => {
           showError('更新失败');
         })
         .finally(() => {
           setLoading(false);
-          props.refresh();
         });
     } catch (error) {
       showError('请检查输入');

+ 1 - 1
web/src/pages/Setting/Operation/SettingsMonitoring.js

@@ -43,13 +43,13 @@ export default function SettingsMonitoring(props) {
           if (res.includes(undefined)) return showError('部分更新失败');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }
 

+ 1 - 1
web/src/pages/Setting/Operation/SettingsSensitiveWords.js

@@ -42,13 +42,13 @@ export default function SettingsSensitiveWords(props) {
           if (res.includes(undefined)) return showError('部分更新失败');
         }
         showSuccess('更新成功');
+        props.refresh();
       })
       .catch(() => {
         showError('更新失败');
       })
       .finally(() => {
         setLoading(false);
-        props.refresh();
       });
   }