From fb6f1bd49699d6c8acc4f8128170923bebed5fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Fri, 30 Jun 2023 09:42:35 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/appsettings.json | 2 +- ZR.Service/System/SysFileService.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ZR.Admin.WebApi/appsettings.json b/ZR.Admin.WebApi/appsettings.json index 0479a4f..17494ba 100644 --- a/ZR.Admin.WebApi/appsettings.json +++ b/ZR.Admin.WebApi/appsettings.json @@ -36,7 +36,7 @@ "DemoMode": false, //是否演示模式 "Upload": { "uploadUrl": "http://localhost:8888", //本地存储资源访问路径 - "localSavePath": "uploads", //本地上传默认文件存储目录 wwwroot/uploads, 如果saveType= 2 (请使用完整路径,比如 /home/resource) + "localSavePath": "", //本地上传默认文件存储目录 wwwroot "maxSize": 15, //上传文件大小限制 15M "notAllowedExt": [ ".bat", ".exe", ".jar", ".js" ] }, diff --git a/ZR.Service/System/SysFileService.cs b/ZR.Service/System/SysFileService.cs index af74251..6573363 100644 --- a/ZR.Service/System/SysFileService.cs +++ b/ZR.Service/System/SysFileService.cs @@ -101,7 +101,7 @@ namespace ZR.Service.System public string GetdirPath(string storePath = "", bool byTimeStore = true) { DateTime date = DateTime.Now; - string timeDir = date.ToString("yyyyMMdd"); + string timeDir = date.ToString("yyyy/MMdd"); if (!string.IsNullOrEmpty(storePath)) { @@ -116,8 +116,7 @@ namespace ZR.Service.System { str = Guid.NewGuid().ToString(); } - MD5 md5 = MD5.Create(); - return BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(str)), 4, 8).Replace("-", ""); + return BitConverter.ToString(MD5.HashData(Encoding.Default.GetBytes(str)), 4, 8).Replace("-", ""); } public Task InsertFile(SysFile file)