From 2ffa8bed3408ff044dbaec37adf0b75c2c1237b5 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Fri, 3 Jul 2026 15:07:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(hooks):=20=E4=BC=98=E5=8C=96=20useImpo?= =?UTF-8?q?rtFile=20=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除自定义 UploadFile 接口,改用 antd 库中的 UploadFile 类型 - 删除未使用的 ImportFileOptions 接口定义 - 简化类型定义,提升代码维护性 - 更新 README,移除重复的 UploadFile 类型说明 --- README.md | 2 -- src/hooks/useImportFile/index.d.ts | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/README.md b/README.md index 18433b0..76a543f 100644 --- a/README.md +++ b/README.md @@ -1419,8 +1419,6 @@ useImportFile("object"): { loading: boolean; importFile: ImportFileFunction } | `options.files` | `UploadFile[]` | 是 | `[]` | 上传文件数组。 | | `options.params` | `Record` | 否 | `{}` | 额外提交参数。 | -`UploadFile`:`originFileObj?: File`,并支持业务扩展字段。 - ### useDownloadFile 引入: diff --git a/src/hooks/useImportFile/index.d.ts b/src/hooks/useImportFile/index.d.ts index bbe2734..653077b 100644 --- a/src/hooks/useImportFile/index.d.ts +++ b/src/hooks/useImportFile/index.d.ts @@ -1,8 +1,4 @@ -export interface UploadFile { - /** 原始文件对象 */ - originFileObj?: File; - [key: string]: any; -} +import type { UploadFile } from "antd/es/upload"; interface UseImportFileOptions { /** 要上传的文件数组 */ @@ -11,11 +7,6 @@ interface UseImportFileOptions { params?: Record; } -export interface ImportFileOptions { - url: string; - options: UseImportFileOptions; -} - export type ImportFileFunction = (url: string, options: UseImportFileOptions) => Promise; /**