浏览代码

删除下载取消来源渠道

Dun.Jason 7 月之前
父节点
当前提交
b7f57ce93a

+ 1 - 1
src/FileStorage.Host/Controllers/FileController.cs

@@ -66,7 +66,7 @@ namespace FileStorage.Host.Controllers
         [HttpGet("downloadfile")]
         public async Task<IActionResult> DownLoadFile([FromQuery] UploadGetDto dto)
         {
-            var (stream, content, fileName) = _fileStorage.DownLoadFile(dto.Id, dto.Source ?? string.Empty);
+            var (stream, content, fileName) = _fileStorage.DownLoadFile(dto.Id);
             if (stream != null)
             {
                 return File(stream, content, fileName);

+ 2 - 2
src/FileStorage/DefaultFileStorage.cs

@@ -90,9 +90,9 @@ public class DefaultFileStorage : IFileStorage, IScopeDependency
         throw new UserFriendlyException("无权限访问");
     }
 
-    public (Stream stream, string contentType, string fileName) DownLoadFile(string id, string clientId)
+    public (Stream stream, string contentType, string fileName) DownLoadFile(string id)
     {
-        var fileMetadata = _fileMetadataRepository.Get(x => x.Id == id && x.Client == clientId);
+        var fileMetadata = _fileMetadataRepository.Get(x => x.Id == id);
         if (fileMetadata != null)
         {
             string filePath = Path.Combine(Directory.GetCurrentDirectory(), fileMetadata.Path);

+ 1 - 1
src/FileStorage/IFileStorage.cs

@@ -17,7 +17,7 @@
 
         Task<Uri> GetFileUrlAsync(string id, string clientId);
 
-        (Stream stream, string contentType,string fileName) DownLoadFile(string id, string clientId);
+        (Stream stream, string contentType,string fileName) DownLoadFile(string id);
 
         Task<bool> DelFileAsync(string id, string clientId);