添加jwt认证模块
This commit is contained in:
7
Yi.Framework.Net6/Yi.Framework.Data/Class1.cs
Normal file
7
Yi.Framework.Net6/Yi.Framework.Data/Class1.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Yi.Framework.Data
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
106
Yi.Framework.Net6/Yi.Framework.Data/DataFilter.cs
Normal file
106
Yi.Framework.Net6/Yi.Framework.Data/DataFilter.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
//using System;
|
||||
//using System.Collections.Concurrent;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
|
||||
//namespace Yi.Framework.Data
|
||||
//{
|
||||
// public class DataFilter : IDataFilter
|
||||
// {
|
||||
// private readonly ConcurrentDictionary<Type, object> _filters;
|
||||
|
||||
// private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
// public DataFilter(IServiceProvider serviceProvider)
|
||||
// {
|
||||
// _serviceProvider = serviceProvider;
|
||||
// _filters = new ConcurrentDictionary<Type, object>();
|
||||
// }
|
||||
|
||||
// public IDisposable Enable<TFilter>()
|
||||
// where TFilter : class
|
||||
// {
|
||||
// return GetFilter<TFilter>().Enable();
|
||||
// }
|
||||
|
||||
// public IDisposable Disable<TFilter>()
|
||||
// where TFilter : class
|
||||
// {
|
||||
// return GetFilter<TFilter>().Disable();
|
||||
// }
|
||||
|
||||
// public bool IsEnabled<TFilter>()
|
||||
// where TFilter : class
|
||||
// {
|
||||
// return GetFilter<TFilter>().IsEnabled;
|
||||
// }
|
||||
|
||||
// private IDataFilter<TFilter> GetFilter<TFilter>()
|
||||
// where TFilter : class
|
||||
// {
|
||||
// return _filters.GetOrAdd(
|
||||
// typeof(TFilter),
|
||||
// valueFactory: (k) => _serviceProvider.GetRequiredService<IDataFilter<TFilter>>()
|
||||
// ) as IDataFilter<TFilter>;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public class DataFilter<TFilter> : IDataFilter<TFilter>
|
||||
// where TFilter : class
|
||||
// {
|
||||
// public bool IsEnabled
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// EnsureInitialized();
|
||||
// return _filter.Value.IsEnabled;
|
||||
// }
|
||||
// }
|
||||
|
||||
// private readonly AbpDataFilterOptions _options;
|
||||
|
||||
// private readonly AsyncLocal<DataFilterState> _filter;
|
||||
|
||||
// public DataFilter(IOptions<AbpDataFilterOptions> options)
|
||||
// {
|
||||
// _options = options.Value;
|
||||
// _filter = new AsyncLocal<DataFilterState>();
|
||||
// }
|
||||
|
||||
// public IDisposable Enable()
|
||||
// {
|
||||
// if (IsEnabled)
|
||||
// {
|
||||
// return NullDisposable.Instance;
|
||||
// }
|
||||
|
||||
// _filter.Value.IsEnabled = true;
|
||||
|
||||
// return new DisposeAction(() => Disable());
|
||||
// }
|
||||
|
||||
// public IDisposable Disable()
|
||||
// {
|
||||
// if (!IsEnabled)
|
||||
// {
|
||||
// return NullDisposable.Instance;
|
||||
// }
|
||||
|
||||
// _filter.Value.IsEnabled = false;
|
||||
|
||||
// return new DisposeAction(() => Enable());
|
||||
// }
|
||||
|
||||
// private void EnsureInitialized()
|
||||
// {
|
||||
// if (_filter.Value != null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// _filter.Value = _options.DefaultStates.GetOrDefault(typeof(TFilter))?.Clone() ?? new DataFilterState(true);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
31
Yi.Framework.Net6/Yi.Framework.Data/IDataFilter.cs
Normal file
31
Yi.Framework.Net6/Yi.Framework.Data/IDataFilter.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
|
||||
//namespace Yi.Framework.Data
|
||||
//{
|
||||
// public interface IDataFilter<TFilter>
|
||||
// where TFilter : class
|
||||
// {
|
||||
// IDisposable Enable();
|
||||
|
||||
// IDisposable Disable();
|
||||
|
||||
// bool IsEnabled { get; }
|
||||
// }
|
||||
|
||||
// public interface IDataFilter
|
||||
// {
|
||||
// IDisposable Enable<TFilter>()
|
||||
// where TFilter : class;
|
||||
|
||||
// IDisposable Disable<TFilter>()
|
||||
// where TFilter : class;
|
||||
|
||||
// bool IsEnabled<TFilter>()
|
||||
// where TFilter : class;
|
||||
// }
|
||||
|
||||
//}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user