Procházet zdrojové kódy

Merge branch 'next' of https://gitee.com/zuohuaijun/Admin.NET into next

zuohuaijun před 3 roky
rodič
revize
11eacea5de

+ 5 - 2
Admin.NET/Admin.NET.Core/Service/Common/CommonService.cs

@@ -1,4 +1,4 @@
-namespace Admin.NET.Core.Service;
+namespace Admin.NET.Core.Service;
 
 public class CommonService : ICommonService, IScoped
 {
@@ -71,7 +71,10 @@ public class CommonService : ICommonService, IScoped
     /// <returns></returns>
     public string GetHost()
     {
-        return $"{_httpContextAccessor.HttpContext.Request.Scheme}://{_httpContextAccessor.HttpContext.Request.Host.Value}";
+         var localhost=$"{_httpContextAccessor.HttpContext.Request.Scheme}://{_httpContextAccessor.HttpContext.Request.Host.Value}";
+        if(_httpContextAccessor.HttpContext.Request.Headers.Referer.Count>0)
+            localhost = _httpContextAccessor.HttpContext.Request.Headers.Referer[0].TrimEnd('/');
+        return localhost;
     }
 
     /// <summary>

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

@@ -128,7 +128,7 @@ public class SysFileService : IDynamicApiController, ITransient
 
             if (_OSSProviderOptions.IsEnable)
             {
-                await _OSSService.RemoveObjectAsync(file.BucketName.ToString(), string.Concat(file.FilePath, "/", input.Id.ToString()));
+                await _OSSService.RemoveObjectAsync(file.BucketName.ToString(), string.Concat(file.FilePath, "/", $"{input.Id}{file.Suffix}"));
             }
             else
             {