|
|
|
@ -1,15 +1,16 @@ |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
|
using Swashbuckle.AspNetCore.Swagger; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Account.Web; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; |
|
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; |
|
|
|
using Volo.Abp.Authorization.Permissions; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.Data; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
@ -19,7 +20,9 @@ using Volo.Abp.Identity.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Identity.Web; |
|
|
|
using Volo.Abp.Localization; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.PermissionManagement; |
|
|
|
using Volo.Abp.PermissionManagement.EntityFrameworkCore; |
|
|
|
using Volo.Abp.PermissionManagement.Identity; |
|
|
|
using Volo.Abp.SettingManagement.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.VirtualFileSystem; |
|
|
|
@ -39,6 +42,8 @@ namespace MyCompanyName.MyProjectName.DemoApp |
|
|
|
typeof(AbpAccountWebModule), |
|
|
|
typeof(AbpIdentityWebModule), |
|
|
|
typeof(AbpIdentityApplicationModule), |
|
|
|
typeof(AbpPermissionManagementApplicationModule), |
|
|
|
typeof(AbpPermissionManagementDomainIdentityModule), |
|
|
|
typeof(AbpAutofacModule), |
|
|
|
typeof(AbpAspNetCoreMvcUiBasicThemeModule) |
|
|
|
)] |
|
|
|
@ -113,15 +118,25 @@ namespace MyCompanyName.MyProjectName.DemoApp |
|
|
|
|
|
|
|
app.UseMvcWithDefaultRouteAndArea(); |
|
|
|
|
|
|
|
AsyncHelper.RunSync(async () => |
|
|
|
using (var scope = context.ServiceProvider.CreateScope()) |
|
|
|
{ |
|
|
|
await context.ServiceProvider |
|
|
|
.GetRequiredService<IIdentityDataSeeder>() |
|
|
|
.SeedAsync( |
|
|
|
"1q2w3E*", |
|
|
|
IdentityPermissions.GetAll().Union(MyProjectNamePermissions.GetAll()) |
|
|
|
); |
|
|
|
}); |
|
|
|
AsyncHelper.RunSync(async () => |
|
|
|
{ |
|
|
|
await scope.ServiceProvider |
|
|
|
.GetRequiredService<IIdentityDataSeeder>() |
|
|
|
.SeedAsync( |
|
|
|
"1q2w3E*" |
|
|
|
); |
|
|
|
|
|
|
|
await scope.ServiceProvider |
|
|
|
.GetRequiredService<IPermissionDataSeeder>() |
|
|
|
.SeedAsync( |
|
|
|
RolePermissionValueProvider.ProviderName, |
|
|
|
"admin", |
|
|
|
IdentityPermissions.GetAll().Union(MyProjectNamePermissions.GetAll()) |
|
|
|
); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|