修改OSS 上传通用配置 6
This commit is contained in:
@@ -19,10 +19,10 @@ using SkiaSharp;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public class MinIOOptions: AWSOptions
|
||||
public class MinIOOptions : AWSOptions
|
||||
{
|
||||
public int port { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class AWSOptions
|
||||
@@ -113,7 +113,7 @@ namespace IRaCIS.Core.Application.Helper
|
||||
|
||||
public OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
{
|
||||
ObjectStoreServiceOptions = options.CurrentValue;
|
||||
ObjectStoreServiceOptions = options.CurrentValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -125,7 +125,10 @@ namespace IRaCIS.Core.Application.Helper
|
||||
/// <returns></returns>
|
||||
public async Task<string> UploadToOSSAsync(Stream fileStream, string oosFolderPath, string fileRealName)
|
||||
{
|
||||
var ossRelativePath = oosFolderPath + "/" + fileRealName;
|
||||
|
||||
|
||||
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{fileRealName}";
|
||||
//var ossRelativePath = oosFolderPath + "/" + fileRealName;
|
||||
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
@@ -204,7 +207,9 @@ namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
var localFileName = Path.GetFileName(localFilePath);
|
||||
|
||||
var ossRelativePath = oosFolderPath + "/" + localFileName;
|
||||
var ossRelativePath = $"{oosFolderPath}/{Guid.NewGuid()}_{localFileName}";
|
||||
|
||||
//var ossRelativePath = oosFolderPath + "/" + localFileName;
|
||||
|
||||
|
||||
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||
|
||||
Reference in New Issue
Block a user