Преглед изворни кода

新增和修改suspense关闭缓存

xyh пре 2 година
родитељ
комит
c243c87f9a

+ 2 - 1
packages/app/src/pages/home/hooks.ts

@@ -35,8 +35,9 @@ export function useMenu() {
     },
     {
       suspense: true,
+      cacheTime: 0,
     },
   );
 
-  return data!;
+  return data;
 }

+ 1 - 0
packages/app/src/pages/role/table/tree-modal/info/hooks.ts

@@ -16,6 +16,7 @@ export function useMenuTree() {
     },
     {
       suspense: true,
+      cacheTime: 0,
     },
   );
 

+ 1 - 0
packages/app/src/pages/storage/table/modal/hooks.ts

@@ -142,6 +142,7 @@ export function useFormInfoValue(id: string) {
     {
       suspense: true,
       enabled: Boolean(id.length),
+      cacheTime: 0,
     },
   );
 

+ 5 - 1
packages/app/src/pages/user/table/modal/hooks.ts

@@ -166,7 +166,11 @@ export function useFetchUserInfo(id: string) {
 
       throw new Error(data.errMsg);
     },
-    {suspense: true, enabled: Boolean(id.length)},
+    {
+      suspense: true,
+      enabled: Boolean(id.length),
+      cacheTime: 0,
+    },
   );
 
   const {setValue} = useFormContext<FormState>();