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