From 6a4e1dc9fc72ff0f95d363917244774849a6fdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Wed, 7 May 2025 15:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E3=80=90=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=EF=BC=9A=E4=BC=98=E5=8C=96=E4=B8=83=E7=89=9B=E4=BA=91?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E6=A8=A1=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreCms.Net.Services/Com/ToolsServices.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CoreCms.Net.Services/Com/ToolsServices.cs b/CoreCms.Net.Services/Com/ToolsServices.cs index 410386ed..00fa0669 100644 --- a/CoreCms.Net.Services/Com/ToolsServices.cs +++ b/CoreCms.Net.Services/Com/ToolsServices.cs @@ -255,6 +255,9 @@ namespace CoreCms.Net.Services var jm = new AdminUiCallBack(); var newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_fffff", DateTimeFormatInfo.InvariantInfo) + fileExt; + var today = DateTime.Now.ToString("yyyyMMdd"); + var filePath = options.Path.TrimStart('/') + today + "/" + newFileName; //云保存路径 + Mac mac = new Mac(options.AccessKeyId, options.AccessKeySecret); @@ -283,7 +286,7 @@ namespace CoreCms.Net.Services config.ChunkSize = ChunkUnit.U512K; UploadManager um = new UploadManager(config); - var outData = um.UploadData(bytes, newFileName, token, null); + var outData = um.UploadData(bytes, filePath, token, null); return options.BucketBindUrl + newFileName; } @@ -426,6 +429,8 @@ namespace CoreCms.Net.Services public string UpLoadBase64ForQiNiuKoDo(FilesStorageOptions options, byte[] bytes) { var newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_fffff", DateTimeFormatInfo.InvariantInfo) + ".jpg"; + var today = DateTime.Now.ToString("yyyyMMdd"); + var filePath = options.Path.TrimStart('/') + today + "/" + newFileName; //云保存路径 Mac mac = new Mac(options.AccessKeyId, options.AccessKeySecret); @@ -447,7 +452,7 @@ namespace CoreCms.Net.Services config.ChunkSize = ChunkUnit.U512K; UploadManager um = new UploadManager(config); - var outData = um.UploadData(bytes, newFileName, token, null); + var outData = um.UploadData(bytes, filePath, token, null); return options.BucketBindUrl + newFileName; }