Ver código fonte

用户列表接口调用优化

XuZinan 2 anos atrás
pai
commit
8f51cc02d5

+ 1 - 3
src/pages/PurchaseAdmin/PurchaseList/Report/Finance.js

@@ -125,9 +125,7 @@ function Finance(props) {
   };
   useEffect(() => {
     handleSearch();
-    dispatch({
-      type: 'user/fetch',
-    });
+    if (!userList.length > 0) dispatch({ type: 'user/fetch' });
   }, []);
 
   return (

+ 1 - 3
src/pages/PurchaseAdmin/PurchaseList/Report/Finance/Project.js

@@ -157,9 +157,7 @@ function FinanceProject(props) {
 
   useEffect(() => {
     handleSearch();
-    dispatch({
-      type: 'user/fetch',
-    });
+    if (!userList.length > 0) dispatch({ type: 'user/fetch' });
   }, []);
 
   return (