Przeglądaj źródła

!1298 修复正确的后缀名
Merge pull request !1298 from IMaster/N/A

IMaster 2 lat temu
rodzic
commit
9b041d998f

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/File/SysFileService.cs

@@ -337,7 +337,7 @@ public class SysFileService : IDynamicApiController, ITransient
         
         // 获取后缀名失败 并且 上传文件为 blob
         if (suffix == "" && file.FileName == "blob")
-            suffix = file.ContentType.Substring(file.ContentType.LastIndexOf('/') + 1); // file.ContentType.Split('/')[1]
+            suffix = "." + file.ContentType.Substring(file.ContentType.LastIndexOf('/') + 1); // file.ContentType.Split('/')[1]
 
         if (string.IsNullOrWhiteSpace(suffix))
             throw Oops.Oh(ErrorCodeEnum.D8003);