|
@@ -57,9 +57,8 @@ namespace GxPress.Api.AppControllers
|
|
|
}
|
|
|
var saveResult = FileHelper.SaveFile(StringUtils.GetWebRootPath(_environment.WebRootPath), file.FileName,
|
|
|
bytes);
|
|
|
- saveResult.AbsolutePath = "https://" + Request.Host.Host +
|
|
|
- (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +
|
|
|
- saveResult.RelativePath;
|
|
|
+ //saveResult.AbsolutePath = "https://" + Request.Host.Host +(Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +saveResult.RelativePath;
|
|
|
+ saveResult.AbsolutePath = StringUtils.AddDomain(saveResult.RelativePath);
|
|
|
saveResult.FileName = file.FileName;
|
|
|
saveResult.FileType = saveResult.FileName.Split('.')[saveResult.FileName.Split('.').Length - 1];
|
|
|
//图片种类
|
|
@@ -107,9 +106,8 @@ namespace GxPress.Api.AppControllers
|
|
|
|
|
|
var saveResult = FileHelper.SaveFile(StringUtils.GetWebRootPath(_environment.WebRootPath), item.FileName,
|
|
|
bytes);
|
|
|
- saveResult.AbsolutePath ="https://" + Request.Host.Host +
|
|
|
- (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +
|
|
|
- saveResult.RelativePath;
|
|
|
+ //saveResult.AbsolutePath = "https://" + Request.Host.Host +(Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +saveResult.RelativePath;
|
|
|
+ saveResult.AbsolutePath = StringUtils.AddDomain(saveResult.RelativePath);
|
|
|
saveResult.FileName = item.FileName;
|
|
|
saveResult.FileType = item.FileName.Split('.')[item.FileName.Split('.').Length - 1];
|
|
|
//图片种类
|
|
@@ -120,8 +118,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 +
|
|
|
- (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty));
|
|
|
+ saveResult = Common.Tools.FileHelper.WebPToImage(StringUtils.GetWebRootPath(_environment.WebRootPath), item.FileName, saveResult, StringUtils.AddDomain(saveResult.RelativePath));
|
|
|
saveResult.FileType = "image";
|
|
|
}
|
|
|
//添加
|
|
@@ -197,8 +194,7 @@ namespace GxPress.Api.AppControllers
|
|
|
|
|
|
var saveResult = FileHelper.SaveFile(StringUtils.GetWebRootPath(_environment.WebRootPath), item.FileName,
|
|
|
bytes);
|
|
|
- saveResult.AbsolutePath = Request.Scheme + "://" + Request.Host.Host +
|
|
|
- (Request.Host.Port > 0 ? $":{Request.Host.Port}" : string.Empty) +
|
|
|
+ saveResult.AbsolutePath =StringUtils.AddDomain(saveResult.RelativePath) +
|
|
|
saveResult.RelativePath;
|
|
|
saveResult.FileName = item.FileName;
|
|
|
saveResult.FileType = item.FileName.Split('.')[item.FileName.Split('.').Length - 1];
|