浏览代码

♻️ refactor(area-tree): 替换区域客户端调用方式

- 从导入 areaClient 改为导入 areaClientManager
- 在 SubTreeLoader 组件中将 areaClient.index.$get 调用替换为 areaClientManager.get().index.$get
- 确保区域树异步加载功能正常工作
yourname 2 天之前
父节点
当前提交
c91533cbf8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/area-management-ui/src/components/AreaTreeAsync.tsx

+ 2 - 2
packages/area-management-ui/src/components/AreaTreeAsync.tsx

@@ -4,7 +4,7 @@ import { Button } from '@d8d/shared-ui-components/components/ui/button';
 import { Badge } from '@d8d/shared-ui-components/components/ui/badge';
 import { cn } from '@d8d/shared-ui-components/utils';
 import { useQuery } from '@tanstack/react-query';
-import { areaClient } from '../api/areaClient';
+import { areaClient, areaClientManager } from '../api/areaClient';
 import type { AreaNode } from '../types/area';
 
 interface AreaTreeAsyncProps {
@@ -46,7 +46,7 @@ const SubTreeLoader: React.FC<SubTreeLoaderProps> = ({
   const { data: subTreeData, isLoading: isSubTreeLoading } = useQuery({
     queryKey: ['areas-subtree', nodeId],
     queryFn: async () => {
-      const res = await areaClient.index.$get({
+      const res = await areaClientManager.get().index.$get({
         query: {
           page: 1,
           pageSize: 100 ,