完善大部分问题
This commit is contained in:
@@ -37,6 +37,8 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
c.Datacenter = consulClientOption.Datacenter;
|
||||
}))
|
||||
{
|
||||
|
||||
client.Agent.ServiceDeregister($"{consulRegisterOption.IP}-{consulRegisterOption.Port}-{Guid.NewGuid()}");
|
||||
client.Agent.ServiceRegister(new AgentServiceRegistration()
|
||||
{
|
||||
ID = $"{consulRegisterOption.IP}-{consulRegisterOption.Port}-{Guid.NewGuid()}",//唯一Id
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Text;
|
||||
using Yi.Framework.Common.Const;
|
||||
using Yi.Framework.Common.Helper;
|
||||
using Yi.Framework.Common.IOCOptions;
|
||||
using Yi.Framework.Core;
|
||||
|
||||
namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
public static IServiceCollection AddJwtService(this IServiceCollection services)
|
||||
{
|
||||
services.Configure<JWTTokenOptions>(Appsettings.appConfiguration("JwtAuthorize"));
|
||||
|
||||
services.AddTransient<JwtInvoker>();
|
||||
var jwtOptions = Appsettings.app<JWTTokenOptions>("JwtAuthorize");
|
||||
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
.AddJwtBearer(options =>
|
||||
|
||||
@@ -11,7 +11,10 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Job;
|
||||
using Yi.Framework.Repository;
|
||||
using Yi.Framework.Service;
|
||||
using Yi.Framework.WebCore.Utility;
|
||||
using Module = Autofac.Module;
|
||||
|
||||
@@ -38,16 +41,16 @@ namespace Yi.Framework.WebCore.Utility
|
||||
|
||||
containerBuilder.RegisterType< HttpContextAccessor>().As<IHttpContextAccessor>().SingleInstance();
|
||||
|
||||
|
||||
|
||||
containerBuilder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
|
||||
containerBuilder.RegisterGeneric(typeof(BaseService<>)).As(typeof(IBaseService<>)).InstancePerLifetimeScope();
|
||||
///反射注入服务层及接口层
|
||||
var assemblysServices = GetDll( "Yi.Framework.Service.dll");
|
||||
containerBuilder.RegisterAssemblyTypes(assemblysServices)
|
||||
.AsImplementedInterfaces()
|
||||
.InstancePerDependency()
|
||||
.InstancePerLifetimeScope()
|
||||
.EnableInterfaceInterceptors();
|
||||
|
||||
///反射注册任务调度层
|
||||
///反射注册任务调度层
|
||||
var assemblysJob = GetDll("Yi.Framework.Job.dll");
|
||||
containerBuilder.RegisterAssemblyTypes(assemblysJob)
|
||||
.InstancePerDependency();
|
||||
|
||||
@@ -35,7 +35,10 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.DTOModel\Yi.Framework.DTOModel.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Interface\Yi.Framework.Interface.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Model\Yi.Framework.Model.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Repository\Yi.Framework.Repository.csproj" />
|
||||
<ProjectReference Include="..\Yi.Framework.Service\Yi.Framework.Service.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user