李昊 il y a 4 ans
Parent
commit
5515fa650f
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      GxPress/Api/GxPress.Api/AppControllers/FileController.cs

+ 3 - 3
GxPress/Api/GxPress.Api/AppControllers/FileController.cs

@@ -57,7 +57,7 @@ namespace GxPress.Api.AppControllers
             }
             var saveResult = FileHelper.SaveFile(StringUtils.GetWebRootPath(_environment.WebRootPath), file.FileName,
                 bytes);
-            saveResult.AbsolutePath = Request.Scheme + "://" + Request.Host.Host +
+            saveResult.AbsolutePath = "https://" + Request.Host.Host +
                                       (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +
                                       saveResult.RelativePath;
             saveResult.FileName = file.FileName;
@@ -107,7 +107,7 @@ namespace GxPress.Api.AppControllers
 
                 var saveResult = FileHelper.SaveFile(StringUtils.GetWebRootPath(_environment.WebRootPath), item.FileName,
                     bytes);
-                saveResult.AbsolutePath = Request.Scheme + "://" + Request.Host.Host +
+                saveResult.AbsolutePath = "https://" + Request.Host.Host +
                                           (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +
                                           saveResult.RelativePath;
                 saveResult.FileName = item.FileName;
@@ -120,7 +120,7 @@ namespace GxPress.Api.AppControllers
                 {
                     saveResult.MinAbsolutePath = StringUtils.AddDomainMin(saveResult.RelativePath);
                     if (saveResult.FileType.ToLower() == "webp")
-                        saveResult = Common.Tools.FileHelper.WebPToImage(StringUtils.GetWebRootPath(_environment.WebRootPath), item.FileName,saveResult,Request.Scheme + "://" + Request.Host.Host +
+                        saveResult = Common.Tools.FileHelper.WebPToImage(StringUtils.GetWebRootPath(_environment.WebRootPath), item.FileName, saveResult, Request.Scheme + "://" + Request.Host.Host +
                                           (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty));
                     saveResult.FileType = "image";
                 }