feat: 搭建多租户框架
This commit is contained in:
@@ -7,6 +7,7 @@ using Microsoft.OpenApi.Models;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
|
||||
using Volo.Abp.AspNetCore.MultiTenancy;
|
||||
using Volo.Abp.AspNetCore.Mvc;
|
||||
using Volo.Abp.AspNetCore.Mvc.AntiForgery;
|
||||
using Volo.Abp.AspNetCore.Serilog;
|
||||
@@ -31,8 +32,9 @@ namespace Yi.Abp.Web
|
||||
[DependsOn(
|
||||
typeof(YiAbpSqlSugarCoreModule),
|
||||
typeof(YiAbpApplicationModule),
|
||||
|
||||
|
||||
|
||||
typeof(AbpAspNetCoreMultiTenancyModule),
|
||||
typeof(AbpAspNetCoreMvcModule),
|
||||
typeof(AbpAutofacModule),
|
||||
typeof(AbpSwashbuckleModule),
|
||||
@@ -105,7 +107,7 @@ namespace Yi.Abp.Web
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
//jwt鉴权
|
||||
var jwtOptions = configuration.GetSection(nameof(JwtOptions)).Get<JwtOptions>();
|
||||
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
||||
@@ -143,7 +145,7 @@ namespace Yi.Abp.Web
|
||||
.AddGitee(options =>
|
||||
{
|
||||
configuration.GetSection("OAuth:Gitee").Bind(options);
|
||||
});
|
||||
});
|
||||
|
||||
//授权
|
||||
context.Services.AddAuthorization();
|
||||
@@ -166,6 +168,9 @@ namespace Yi.Abp.Web
|
||||
//鉴权
|
||||
app.UseAuthentication();
|
||||
|
||||
//多租户
|
||||
app.UseMultiTenancy();
|
||||
|
||||
//swagger
|
||||
app.UseYiSwagger();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user