From 5fd703673f490dbcd1768fe18251316ac7602e05 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 07 八月 2025 10:03:39 +0800
Subject: [PATCH] feat: 更新框架

---
 src/utils/common/file.ts |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/utils/common/file.ts b/src/utils/common/file.ts
index 25cbd9a..7346b89 100644
--- a/src/utils/common/file.ts
+++ b/src/utils/common/file.ts
@@ -8,12 +8,17 @@
   return _url.startsWith('/') ? _url : '/' + _url;
 }
 
+type ConvertApi2FormUrlOptions = {
+  fileName?: string;
+};
+
 /**
  * 鎶奱pi杩斿洖鐨勮矾寰勮浆鎹负upload鐨勮矾寰�
  */
-export function convertApi2FormUrl(path: string) {
+export function convertApi2FormUrl(path: string, options: ConvertApi2FormUrlOptions = {}) {
+  const { fileName } = options;
   return {
-    name: setOssFileName(path),
+    name: fileName ? fileName : setOssFileName(path),
     path: urlOmitDomain(path),
     url: setOSSLink(path),
     status: 'success',
@@ -21,8 +26,8 @@
   } as UploadUserFile;
 }
 
-export function convertApi2FormUrlOnlyOne(path: string) {
-  return path ? [convertApi2FormUrl(path)] : [];
+export function convertApi2FormUrlOnlyOne(path: string, options: ConvertApi2FormUrlOptions = {}) {
+  return path ? [convertApi2FormUrl(path, options)] : [];
 }
 
 /**

--
Gitblit v1.9.1