服务端不暂支持 .net framework ,支持最新 .netcore 添加七牛接口的支持,客户端修改了已知的bug 并对layui支持, .net framework版本的可以下载v1.0.0 分支
This commit is contained in:
@@ -26,19 +26,19 @@ namespace Ufangx.FileServices
|
|||||||
|
|
||||||
public IEnumerable<string> AuthenticationSchemes => options.AuthenticationSchemes;
|
public IEnumerable<string> AuthenticationSchemes => options.AuthenticationSchemes;
|
||||||
|
|
||||||
public string DefaultSchemeName => options.DefaultTopic;
|
public string DefaultSchemeName => options.DefaultScheme;
|
||||||
|
|
||||||
FileServiceScheme GetScheme(string name) {
|
FileServiceScheme GetScheme(string name) {
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
if (string.IsNullOrWhiteSpace(name))
|
||||||
{
|
{
|
||||||
throw new ArgumentException("message", nameof(name));
|
throw new ArgumentException("message", nameof(name));
|
||||||
}
|
}
|
||||||
var topic = options.SchemeMap[name];
|
var scheme = options.SchemeMap[name];
|
||||||
if (topic == null)
|
if (scheme == null)
|
||||||
{
|
{
|
||||||
throw new Exception($"无效的文件服务方案名称“{name}”");
|
throw new Exception($"无效的文件服务方案名称“{name}”");
|
||||||
}
|
}
|
||||||
return topic;
|
return scheme;
|
||||||
}
|
}
|
||||||
public IFileHandler GetHandler(string schemeName)
|
public IFileHandler GetHandler(string schemeName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Ufangx.FileServices.Models
|
|||||||
{
|
{
|
||||||
private readonly IList<FileServiceScheme> _schemes = new List<FileServiceScheme>();
|
private readonly IList<FileServiceScheme> _schemes = new List<FileServiceScheme>();
|
||||||
private readonly IList<string> _authenticationSchemes = new List<string>();
|
private readonly IList<string> _authenticationSchemes = new List<string>();
|
||||||
public string DefaultTopic { get; set; }
|
public string DefaultScheme { get; set; }
|
||||||
public IEnumerable<FileServiceScheme> Schemes => _schemes;
|
public IEnumerable<FileServiceScheme> Schemes => _schemes;
|
||||||
public IEnumerable<string> AuthenticationSchemes => _authenticationSchemes;
|
public IEnumerable<string> AuthenticationSchemes => _authenticationSchemes;
|
||||||
public IDictionary<string, FileServiceScheme> SchemeMap { get; } = new Dictionary<string, FileServiceScheme>(StringComparer.Ordinal);
|
public IDictionary<string, FileServiceScheme> SchemeMap { get; } = new Dictionary<string, FileServiceScheme>(StringComparer.Ordinal);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace TestWeb
|
|||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddHttpContextAccessor();
|
services.AddHttpContextAccessor();
|
||||||
services.AddFileServiceBuilder(opt=>opt.DefaultTopic="")
|
services.AddFileServiceBuilder(opt=>opt.DefaultScheme="")
|
||||||
.AddLocalServices(o => o.StorageRootDir = hostEnvironment.ContentRootPath);
|
.AddLocalServices(o => o.StorageRootDir = hostEnvironment.ContentRootPath);
|
||||||
services.AddControllersWithViews();
|
services.AddControllersWithViews();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user