|
@ -26,6 +26,7 @@ using Volo.Abp.Autofac; |
|
|
using Volo.Abp.BackgroundJobs.Hangfire; |
|
|
using Volo.Abp.BackgroundJobs.Hangfire; |
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.BlobStoring.FileSystem; |
|
|
using Volo.Abp.BlobStoring.FileSystem; |
|
|
|
|
|
using Volo.Abp.BlobStoring.Minio; |
|
|
using Volo.Abp.Caching; |
|
|
using Volo.Abp.Caching; |
|
|
using Volo.Abp.Data; |
|
|
using Volo.Abp.Data; |
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer; |
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer; |
|
@ -162,20 +163,35 @@ namespace Win.Sfs.SettleAccount |
|
|
/// 上传文件的容器
|
|
|
/// 上传文件的容器
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="context"></param>
|
|
|
/// <param name="context"></param>
|
|
|
private void ConfigureBLOBServices(IConfiguration configPath) |
|
|
private void ConfigureBLOBServices(IConfiguration cfg) |
|
|
{ |
|
|
{ |
|
|
|
|
|
//Configure<AbpBlobStoringOptions>(options =>
|
|
|
|
|
|
//{
|
|
|
|
|
|
// options.Containers.Configure<MyFileContainer>(configuration =>
|
|
|
|
|
|
// {
|
|
|
|
|
|
// configuration.UseFileSystem(fileSystem =>
|
|
|
|
|
|
// {
|
|
|
|
|
|
// var filestreampath = Environment.CurrentDirectory + @"\wwwroot\files";
|
|
|
|
|
|
// if (!Directory.Exists(filestreampath))
|
|
|
|
|
|
// {
|
|
|
|
|
|
// Directory.CreateDirectory(filestreampath);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// fileSystem.BasePath = filestreampath;
|
|
|
|
|
|
// });
|
|
|
|
|
|
// });
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
Configure<AbpBlobStoringOptions>(options => |
|
|
Configure<AbpBlobStoringOptions>(options => |
|
|
{ |
|
|
{ |
|
|
options.Containers.Configure<MyFileContainer>(configuration => |
|
|
options.Containers.ConfigureDefault(container => |
|
|
{ |
|
|
|
|
|
configuration.UseFileSystem(fileSystem => |
|
|
|
|
|
{ |
|
|
{ |
|
|
var filestreampath = Environment.CurrentDirectory + @"\wwwroot\files"; |
|
|
container.UseMinio(minio => |
|
|
if (!Directory.Exists(filestreampath)) |
|
|
|
|
|
{ |
|
|
{ |
|
|
Directory.CreateDirectory(filestreampath); |
|
|
minio.EndPoint = cfg.GetValue("MinIO:EndPoint", "localhost:10684"); |
|
|
} |
|
|
minio.AccessKey = cfg.GetValue("MinIO:AccessKey", "g0GKnhRGEQHI0uiGBYre"); |
|
|
fileSystem.BasePath = filestreampath; |
|
|
minio.SecretKey = cfg.GetValue("MinIO:SecretKey", "iKGlLz6UBzci3xrERw5Zz1gI77enT5u9agFemHPv"); |
|
|
|
|
|
minio.BucketName = cfg.GetValue("MinIO:BucketName", "default"); |
|
|
|
|
|
minio.WithSSL = false; |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|