119 changed files with 2187 additions and 3116 deletions
File diff suppressed because it is too large
@ -0,0 +1,194 @@ |
|||
2022-08-24 13:26:53.260 +08:00 [INF] Loaded ABP modules: |
|||
2022-08-24 13:26:53.307 +08:00 [INF] - Lion.AbpPro.BasicManagement.BasicManagementHttpApiHostModule |
|||
2022-08-24 13:26:53.308 +08:00 [INF] - Lion.AbpPro.BasicManagement.BasicManagementApplicationModule |
|||
2022-08-24 13:26:53.309 +08:00 [INF] - Lion.AbpPro.BasicManagement.BasicManagementDomainModule |
|||
2022-08-24 13:26:53.309 +08:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule |
|||
2022-08-24 13:26:53.310 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule |
|||
2022-08-24 13:26:53.311 +08:00 [INF] - Volo.Abp.Data.AbpDataModule |
|||
2022-08-24 13:26:53.311 +08:00 [INF] - Volo.Abp.ObjectExtending.AbpObjectExtendingModule |
|||
2022-08-24 13:26:53.312 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationAbstractionsModule |
|||
2022-08-24 13:26:53.328 +08:00 [INF] - Volo.Abp.Validation.AbpValidationAbstractionsModule |
|||
2022-08-24 13:26:53.330 +08:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule |
|||
2022-08-24 13:26:53.332 +08:00 [INF] - Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule |
|||
2022-08-24 13:26:53.333 +08:00 [INF] - Volo.Abp.Json.AbpJsonModule |
|||
2022-08-24 13:26:53.333 +08:00 [INF] - Volo.Abp.Timing.AbpTimingModule |
|||
2022-08-24 13:26:53.334 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule |
|||
2022-08-24 13:26:53.335 +08:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule |
|||
2022-08-24 13:26:53.336 +08:00 [INF] - Volo.Abp.Settings.AbpSettingsModule |
|||
2022-08-24 13:26:53.336 +08:00 [INF] - Volo.Abp.Security.AbpSecurityModule |
|||
2022-08-24 13:26:53.337 +08:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyModule |
|||
2022-08-24 13:26:53.338 +08:00 [INF] - Volo.Abp.Threading.AbpThreadingModule |
|||
2022-08-24 13:26:53.338 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingContractsModule |
|||
2022-08-24 13:26:53.339 +08:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule |
|||
2022-08-24 13:26:53.340 +08:00 [INF] - Volo.Abp.Guids.AbpGuidsModule |
|||
2022-08-24 13:26:53.340 +08:00 [INF] - Volo.Abp.BackgroundWorkers.AbpBackgroundWorkersModule |
|||
2022-08-24 13:26:53.341 +08:00 [INF] - Volo.Abp.DistributedLocking.AbpDistributedLockingAbstractionsModule |
|||
2022-08-24 13:26:53.342 +08:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule |
|||
2022-08-24 13:26:53.343 +08:00 [INF] - Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule |
|||
2022-08-24 13:26:53.344 +08:00 [INF] - Volo.Abp.Specifications.AbpSpecificationsModule |
|||
2022-08-24 13:26:53.345 +08:00 [INF] - Lion.AbpPro.BasicManagement.BasicManagementDomainSharedModule |
|||
2022-08-24 13:26:53.346 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule |
|||
2022-08-24 13:26:53.348 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainSharedModule |
|||
2022-08-24 13:26:53.357 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementDomainSharedModule |
|||
2022-08-24 13:26:53.359 +08:00 [INF] - Volo.Abp.Validation.AbpValidationModule |
|||
2022-08-24 13:26:53.365 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityDomainSharedModule |
|||
2022-08-24 13:26:53.377 +08:00 [INF] - Volo.Abp.Users.AbpUsersDomainSharedModule |
|||
2022-08-24 13:26:53.383 +08:00 [INF] - Volo.Abp.Features.AbpFeaturesModule |
|||
2022-08-24 13:26:53.385 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule |
|||
2022-08-24 13:26:53.392 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule |
|||
2022-08-24 13:26:53.405 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule |
|||
2022-08-24 13:26:53.430 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementDomainSharedModule |
|||
2022-08-24 13:26:53.449 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule |
|||
2022-08-24 13:26:53.460 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule |
|||
2022-08-24 13:26:53.466 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsModule |
|||
2022-08-24 13:26:53.468 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsAbstractionsModule |
|||
2022-08-24 13:26:53.470 +08:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule |
|||
2022-08-24 13:26:53.474 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementDomainModule |
|||
2022-08-24 13:26:53.478 +08:00 [INF] - Volo.Abp.Caching.AbpCachingModule |
|||
2022-08-24 13:26:53.479 +08:00 [INF] - Volo.Abp.Serialization.AbpSerializationModule |
|||
2022-08-24 13:26:53.480 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityDomainModule |
|||
2022-08-24 13:26:53.481 +08:00 [INF] - Volo.Abp.Users.AbpUsersDomainModule |
|||
2022-08-24 13:26:53.482 +08:00 [INF] - Volo.Abp.Users.AbpUsersAbstractionModule |
|||
2022-08-24 13:26:53.483 +08:00 [INF] - Volo.Abp.PermissionManagement.Identity.AbpPermissionManagementDomainIdentityModule |
|||
2022-08-24 13:26:53.484 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule |
|||
2022-08-24 13:26:53.485 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule |
|||
2022-08-24 13:26:53.487 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule |
|||
2022-08-24 13:26:53.489 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementDomainModule |
|||
2022-08-24 13:26:53.498 +08:00 [INF] - Lion.AbpPro.BasicManagement.BasicManagementApplicationContractsModule |
|||
2022-08-24 13:26:53.499 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationContractsModule |
|||
2022-08-24 13:26:53.500 +08:00 [INF] - Volo.Abp.Account.AbpAccountApplicationContractsModule |
|||
2022-08-24 13:26:53.501 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityApplicationContractsModule |
|||
2022-08-24 13:26:53.503 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationContractsModule |
|||
2022-08-24 13:26:53.504 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementApplicationContractsModule |
|||
2022-08-24 13:26:53.505 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementApplicationContractsModule |
|||
2022-08-24 13:26:53.510 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementApplicationContractsModule |
|||
2022-08-24 13:26:53.511 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule |
|||
2022-08-24 13:26:53.512 +08:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule |
|||
2022-08-24 13:26:53.514 +08:00 [INF] - Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule |
|||
2022-08-24 13:26:53.516 +08:00 [INF] - Volo.Abp.Identity.AspNetCore.AbpIdentityAspNetCoreModule |
|||
2022-08-24 13:26:53.517 +08:00 [INF] - Volo.Abp.Account.AbpAccountApplicationModule |
|||
2022-08-24 13:26:53.518 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityApplicationModule |
|||
2022-08-24 13:26:53.529 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationModule |
|||
2022-08-24 13:26:53.531 +08:00 [INF] - Volo.Abp.UI.Navigation.AbpUiNavigationModule |
|||
2022-08-24 13:26:53.532 +08:00 [INF] - Volo.Abp.UI.AbpUiModule |
|||
2022-08-24 13:26:53.533 +08:00 [INF] - Volo.Abp.Emailing.AbpEmailingModule |
|||
2022-08-24 13:26:53.534 +08:00 [INF] - Volo.Abp.TextTemplating.AbpTextTemplatingModule |
|||
2022-08-24 13:26:53.535 +08:00 [INF] - Volo.Abp.TextTemplating.Scriban.AbpTextTemplatingScribanModule |
|||
2022-08-24 13:26:53.536 +08:00 [INF] - Volo.Abp.TextTemplating.AbpTextTemplatingCoreModule |
|||
2022-08-24 13:26:53.537 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementApplicationModule |
|||
2022-08-24 13:26:53.542 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementApplicationModule |
|||
2022-08-24 13:26:53.543 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementApplicationModule |
|||
2022-08-24 13:26:53.544 +08:00 [INF] - Lion.AbpPro.BasicManagement.EntityFrameworkCore.BasicManagementEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.545 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.547 +08:00 [INF] - Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.548 +08:00 [INF] - Volo.Abp.Users.EntityFrameworkCore.AbpUsersEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.549 +08:00 [INF] - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.549 +08:00 [INF] - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.550 +08:00 [INF] - Volo.Abp.BackgroundJobs.EntityFrameworkCore.AbpBackgroundJobsEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.551 +08:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.552 +08:00 [INF] - Volo.Abp.TenantManagement.EntityFrameworkCore.AbpTenantManagementEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.559 +08:00 [INF] - Volo.Abp.FeatureManagement.EntityFrameworkCore.AbpFeatureManagementEntityFrameworkCoreModule |
|||
2022-08-24 13:26:53.561 +08:00 [INF] - Lion.AbpPro.BasicManagement.BasicManagementHttpApiModule |
|||
2022-08-24 13:26:53.563 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule |
|||
2022-08-24 13:26:53.564 +08:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule |
|||
2022-08-24 13:26:53.565 +08:00 [INF] - Volo.Abp.Http.AbpHttpModule |
|||
2022-08-24 13:26:53.566 +08:00 [INF] - Volo.Abp.Minify.AbpMinifyModule |
|||
2022-08-24 13:26:53.566 +08:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule |
|||
2022-08-24 13:26:53.567 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule |
|||
2022-08-24 13:26:53.568 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.AbpAspNetCoreMvcUiMultiTenancyModule |
|||
2022-08-24 13:26:53.572 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.AbpAspNetCoreMvcUiThemeSharedModule |
|||
2022-08-24 13:26:53.572 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.AbpAspNetCoreMvcUiBootstrapModule |
|||
2022-08-24 13:26:53.573 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.AbpAspNetCoreMvcUiModule |
|||
2022-08-24 13:26:53.574 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Packages.AbpAspNetCoreMvcUiPackagesModule |
|||
2022-08-24 13:26:53.575 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingAbstractionsModule |
|||
2022-08-24 13:26:53.576 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpAspNetCoreMvcUiWidgetsModule |
|||
2022-08-24 13:26:53.577 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingModule |
|||
2022-08-24 13:26:53.578 +08:00 [INF] - Volo.Abp.AspNetCore.MultiTenancy.AbpAspNetCoreMultiTenancyModule |
|||
2022-08-24 13:26:53.579 +08:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule |
|||
2022-08-24 13:26:53.580 +08:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule |
|||
2022-08-24 13:26:53.581 +08:00 [INF] - Volo.Abp.Caching.StackExchangeRedis.AbpCachingStackExchangeRedisModule |
|||
2022-08-24 13:26:53.582 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.MySQL.AbpEntityFrameworkCoreMySQLModule |
|||
2022-08-24 13:26:53.586 +08:00 [INF] - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule |
|||
2022-08-24 13:26:53.586 +08:00 [INF] - Volo.Abp.Swashbuckle.AbpSwashbuckleModule |
|||
2022-08-24 13:26:55.071 +08:00 [INF] Initialized all ABP modules. |
|||
2022-08-24 13:26:55.132 +08:00 [INF] Now listening on: http://localhost:44324 |
|||
2022-08-24 13:26:55.135 +08:00 [INF] Application started. Press Ctrl+C to shut down. |
|||
2022-08-24 13:26:55.137 +08:00 [INF] Hosting environment: Development |
|||
2022-08-24 13:26:55.138 +08:00 [INF] Content root path: D:\github\WangJunZzz\abp-vnext-pro\aspnet-core\modules\BasicManagement\host\Lion.AbpPro.BasicManagement.HttpApi.Host |
|||
2022-08-24 13:26:55.302 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44324/ - - |
|||
2022-08-24 13:26:59.596 +08:00 [INF] Executing endpoint 'Lion.AbpPro.BasicManagement.Controllers.HomeController.Index (Lion.AbpPro.BasicManagement.HttpApi.Host)' |
|||
2022-08-24 13:26:59.625 +08:00 [INF] Route matched with {action = "Index", controller = "Home", area = "", page = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult Index() on controller Lion.AbpPro.BasicManagement.Controllers.HomeController (Lion.AbpPro.BasicManagement.HttpApi.Host). |
|||
2022-08-24 13:26:59.664 +08:00 [INF] Executing RedirectResult, redirecting to /swagger. |
|||
2022-08-24 13:26:59.672 +08:00 [INF] Executed action Lion.AbpPro.BasicManagement.Controllers.HomeController.Index (Lion.AbpPro.BasicManagement.HttpApi.Host) in 40.2794ms |
|||
2022-08-24 13:26:59.684 +08:00 [INF] Executed endpoint 'Lion.AbpPro.BasicManagement.Controllers.HomeController.Index (Lion.AbpPro.BasicManagement.HttpApi.Host)' |
|||
2022-08-24 13:26:59.721 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44324/ - - - 302 0 - 4419.2778ms |
|||
2022-08-24 13:26:59.733 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44324/swagger - - |
|||
2022-08-24 13:26:59.739 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44324/swagger - - - 301 0 - 6.0422ms |
|||
2022-08-24 13:26:59.746 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44324/swagger/index.html - - |
|||
2022-08-24 13:26:59.798 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44324/swagger/index.html - - - 200 - text/html;charset=utf-8 52.2946ms |
|||
2022-08-24 13:27:00.125 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44324/swagger/BasicManagement/swagger.json - - |
|||
2022-08-24 13:27:00.451 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44324/swagger/BasicManagement/swagger.json - - - 200 - application/json;charset=utf-8 326.7641ms |
|||
2022-08-24 13:27:10.772 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44324/abp/Swashbuckle/SetCsrfCookie application/json - |
|||
2022-08-24 13:27:10.775 +08:00 [INF] Executing endpoint 'Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle)' |
|||
2022-08-24 13:27:10.779 +08:00 [INF] Route matched with {area = "Abp", action = "SetCsrfCookie", controller = "AbpSwashbuckle", page = ""}. Executing controller action with signature Void SetCsrfCookie() on controller Volo.Abp.Swashbuckle.AbpSwashbuckleController (Volo.Abp.Swashbuckle). |
|||
2022-08-24 13:27:10.792 +08:00 [WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'. |
|||
2022-08-24 13:27:10.794 +08:00 [INF] Executed action Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle) in 13.0704ms |
|||
2022-08-24 13:27:10.795 +08:00 [INF] Executed endpoint 'Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle)' |
|||
2022-08-24 13:27:10.796 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44324/abp/Swashbuckle/SetCsrfCookie application/json - - 204 - - 24.2157ms |
|||
2022-08-24 13:27:10.835 +08:00 [INF] Request starting HTTP/1.1 POST http://localhost:44324/api/app/account/login application/json 46 |
|||
2022-08-24 13:27:10.838 +08:00 [INF] No CORS policy found for the specified request. |
|||
2022-08-24 13:27:10.840 +08:00 [INF] Executing endpoint 'Lion.AbpPro.BasicManagement.Systems.AccountController.LoginAsync (Lion.AbpPro.BasicManagement.HttpApi)' |
|||
2022-08-24 13:27:10.852 +08:00 [INF] Route matched with {action = "Login", controller = "Account", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Lion.AbpPro.BasicManagement.Users.Dtos.LoginOutput] LoginAsync(Lion.AbpPro.BasicManagement.Users.Dtos.LoginInput) on controller Lion.AbpPro.BasicManagement.Systems.AccountController (Lion.AbpPro.BasicManagement.HttpApi). |
|||
2022-08-24 13:27:10.869 +08:00 [ERR] The antiforgery token could not be decrypted. |
|||
2022-08-24 13:27:10.871 +08:00 [INF] Authorization failed for the request at filter 'Volo.Abp.AspNetCore.Mvc.AntiForgery.AbpAutoValidateAntiforgeryTokenAuthorizationFilter'. |
|||
2022-08-24 13:27:10.875 +08:00 [INF] Executing StatusCodeResult, setting HTTP status code 400 |
|||
2022-08-24 13:27:10.876 +08:00 [INF] Executed action Lion.AbpPro.BasicManagement.Systems.AccountController.LoginAsync (Lion.AbpPro.BasicManagement.HttpApi) in 23.3032ms |
|||
2022-08-24 13:27:10.877 +08:00 [INF] Executed endpoint 'Lion.AbpPro.BasicManagement.Systems.AccountController.LoginAsync (Lion.AbpPro.BasicManagement.HttpApi)' |
|||
2022-08-24 13:27:11.232 +08:00 [INF] Request finished HTTP/1.1 POST http://localhost:44324/api/app/account/login application/json 46 - 400 0 - 397.1138ms |
|||
2022-08-24 13:27:21.937 +08:00 [INF] Request starting HTTP/1.1 POST http://localhost:44324/api/app/account/login application/json 46 |
|||
2022-08-24 13:27:21.939 +08:00 [INF] No CORS policy found for the specified request. |
|||
2022-08-24 13:27:21.941 +08:00 [INF] Executing endpoint 'Lion.AbpPro.BasicManagement.Systems.AccountController.LoginAsync (Lion.AbpPro.BasicManagement.HttpApi)' |
|||
2022-08-24 13:27:21.942 +08:00 [INF] Route matched with {action = "Login", controller = "Account", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Lion.AbpPro.BasicManagement.Users.Dtos.LoginOutput] LoginAsync(Lion.AbpPro.BasicManagement.Users.Dtos.LoginInput) on controller Lion.AbpPro.BasicManagement.Systems.AccountController (Lion.AbpPro.BasicManagement.HttpApi). |
|||
2022-08-24 13:27:23.234 +08:00 [WRN] ---------- RemoteServiceErrorInfo ---------- |
|||
{ |
|||
"code": "Lion.AbpPro.BasicManagement:100003", |
|||
"message": "用户名或者密码错误", |
|||
"details": null, |
|||
"data": {}, |
|||
"validationErrors": null |
|||
} |
|||
|
|||
2022-08-24 13:27:23.238 +08:00 [WRN] Exception of type 'Volo.Abp.BusinessException' was thrown. |
|||
Volo.Abp.BusinessException: Exception of type 'Volo.Abp.BusinessException' was thrown. |
|||
at Lion.AbpPro.BasicManagement.Users.AccountAppService.LoginAsync(LoginInput input) in D:\github\WangJunZzz\abp-vnext-pro\aspnet-core\modules\BasicManagement\src\Lion.AbpPro.BasicManagement.Application\Users\AccountAppService.cs:line 39 |
|||
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() |
|||
at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) |
|||
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() |
|||
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) |
|||
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() |
|||
at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) |
|||
at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) |
|||
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() |
|||
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) |
|||
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) |
|||
at lambda_method1387(Closure , Object ) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) |
|||
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) |
|||
2022-08-24 13:27:23.297 +08:00 [WRN] Code:Lion.AbpPro.BasicManagement:100003 |
|||
2022-08-24 13:27:23.298 +08:00 [WRN] Details: |
|||
2022-08-24 13:27:23.313 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. |
|||
2022-08-24 13:27:23.322 +08:00 [INF] Executed action Lion.AbpPro.BasicManagement.Systems.AccountController.LoginAsync (Lion.AbpPro.BasicManagement.HttpApi) in 1378.6532ms |
|||
2022-08-24 13:27:23.327 +08:00 [INF] Executed endpoint 'Lion.AbpPro.BasicManagement.Systems.AccountController.LoginAsync (Lion.AbpPro.BasicManagement.HttpApi)' |
|||
2022-08-24 13:27:23.401 +08:00 [INF] Request finished HTTP/1.1 POST http://localhost:44324/api/app/account/login application/json 46 - 403 - application/json;+charset=utf-8 1463.5504ms |
|||
@ -1,43 +0,0 @@ |
|||
namespace Lion.AbpPro.AuditLogs |
|||
{ |
|||
public class GetAuditLogPageListOutput |
|||
{ |
|||
public string ApplicationName { get; set; } |
|||
|
|||
public Guid? UserId { get; set; } |
|||
|
|||
public string UserName { get; set; } |
|||
|
|||
public Guid? TenantId { get; set; } |
|||
|
|||
public string TenantName { get; set; } |
|||
|
|||
public Guid? ImpersonatorUserId { get; set; } |
|||
|
|||
public Guid? ImpersonatorTenantId { get; set; } |
|||
|
|||
public DateTime ExecutionTime { get; set; } |
|||
|
|||
public int ExecutionDuration { get; set; } |
|||
|
|||
public string ClientIpAddress { get; set; } |
|||
|
|||
public string ClientName { get; set; } |
|||
|
|||
public string ClientId { get; set; } |
|||
|
|||
public string CorrelationId { get; set; } |
|||
|
|||
public string BrowserInfo { get; set; } |
|||
|
|||
public string HttpMethod { get; set; } |
|||
|
|||
public string Url { get; set; } |
|||
|
|||
public string Exceptions { get; set; } |
|||
|
|||
public string Comments { get; set; } |
|||
|
|||
public int? HttpStatusCode { get; set; } |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
namespace Lion.AbpPro.AuditLogs |
|||
{ |
|||
public interface IAuditLogAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 分页查询审计日志
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<PagedResultDto<GetAuditLogPageListOutput>> GetListAsync(PagingAuditLogListInput input); |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
namespace Lion.AbpPro.AuditLogs |
|||
{ |
|||
public class PagingAuditLogListInput : PagingBase |
|||
{ |
|||
public string Sorting { get; set; } |
|||
public DateTime? StartTime { get; set; } |
|||
public DateTime? EndTime { get; set; } |
|||
public string HttpMethod { get; set; } |
|||
public string Url { get; set; } |
|||
public string UserName { get; set; } |
|||
public string ApplicationName { get; set; } |
|||
public string CorrelationId { get; set; } |
|||
public int? MaxExecutionDuration { get; set; } |
|||
public int? MinExecutionDuration { get; set; } |
|||
public bool? HasException { get; set; } |
|||
|
|||
public HttpStatusCode? HttpStatusCode { get; set; } |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
namespace Lion.AbpPro.ConfigurationOptions |
|||
{ |
|||
public class JwtOptions |
|||
{ |
|||
public int ExpirationTime { get; set; } |
|||
|
|||
public string Audience { get; set; } |
|||
|
|||
public string SecurityKey { get; set; } |
|||
|
|||
public string Issuer { get; set; } |
|||
} |
|||
} |
|||
@ -1,35 +1,15 @@ |
|||
// Global using directives
|
|||
|
|||
global using System; |
|||
global using System.Collections.Generic; |
|||
global using System.ComponentModel.DataAnnotations; |
|||
global using System.Net; |
|||
global using System.Threading.Tasks; |
|||
global using Lion.AbpPro.DataDictionaryManagement; |
|||
global using Lion.AbpPro.Extension.Customs.Dtos; |
|||
global using Lion.AbpPro.FileManagement; |
|||
global using Lion.AbpPro.OrganizationUnits.Dto; |
|||
global using Lion.AbpPro.Roles.Dtos; |
|||
global using Lion.AbpPro.Settings.Dtos; |
|||
global using Lion.AbpPro.Tenants.Dtos; |
|||
global using Lion.AbpPro.Users.Dtos; |
|||
global using Magicodes.ExporterAndImporter.Core; |
|||
global using Microsoft.AspNetCore.Mvc; |
|||
global using Newtonsoft.Json; |
|||
global using Volo.Abp.Account; |
|||
global using Volo.Abp.Application.Dtos; |
|||
global using Volo.Abp.Application.Services; |
|||
global using Volo.Abp.AspNetCore.Mvc.MultiTenancy; |
|||
global using Volo.Abp.Auditing; |
|||
global using Volo.Abp.Authorization.Permissions; |
|||
global using Volo.Abp.DependencyInjection; |
|||
global using Volo.Abp.FeatureManagement; |
|||
global using Volo.Abp.Identity; |
|||
global using Volo.Abp.Localization; |
|||
global using Volo.Abp.Modularity; |
|||
global using Volo.Abp.MultiTenancy; |
|||
global using Volo.Abp.ObjectExtending; |
|||
global using Volo.Abp.PermissionManagement; |
|||
global using Volo.Abp.SettingManagement; |
|||
global using Volo.Abp.TenantManagement; |
|||
global using Volo.Abp.Threading; |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class AddRoleToOrganizationUnitInput |
|||
{ |
|||
public List<Guid> RoleId { get; set; } |
|||
|
|||
public Guid OrganizationUnitId { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class AddUserToOrganizationUnitInput |
|||
{ |
|||
public List<Guid> UserId { get; set; } |
|||
|
|||
public Guid OrganizationUnitId { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class CreateOrganizationUnitInput |
|||
{ |
|||
[Required] public string DisplayName { get; set; } |
|||
|
|||
public Guid? ParentId { get; set; } |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetOrganizationUnitRoleInput : PagingBase |
|||
{ |
|||
public Guid OrganizationUnitId { get; set; } |
|||
|
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetOrganizationUnitRoleOutput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public string Name { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetOrganizationUnitUserInput : PagingBase |
|||
{ |
|||
public Guid OrganizationUnitId { get; set; } |
|||
|
|||
public string Filter { get; set; } |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetOrganizationUnitUserOutput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public string UserName { get; set; } |
|||
|
|||
public string Email { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetUnAddRoleInput : PagingBase |
|||
{ |
|||
public Guid OrganizationUnitId { get; set; } |
|||
|
|||
public string Filter { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetUnAddRoleOutput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public string Name { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetUnAddUserInput : PagingBase |
|||
{ |
|||
public Guid OrganizationUnitId { get; set; } |
|||
|
|||
public string Filter { get; set; } |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class GetUnAddUserOutput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public string UserName { get; set; } |
|||
|
|||
public string Email { get; set; } |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class OrganizationUnitDto |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public Guid? TenantId { get; set; } |
|||
|
|||
public string Code { get; set; } |
|||
|
|||
public string DisplayName { get; set; } |
|||
|
|||
public Guid? ParentId { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class RemoveRoleToOrganizationUnitInput |
|||
{ |
|||
public Guid RoleId { get; set; } |
|||
|
|||
public Guid OrganizationUnitId { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class RemoveUserToOrganizationUnitInput |
|||
{ |
|||
public Guid UserId { get; set; } |
|||
|
|||
public Guid OrganizationUnitId { get; set; } |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class TreeOutput |
|||
{ |
|||
public string Title { get; set; } |
|||
|
|||
public Guid Key { get; set; } |
|||
|
|||
public List<TreeOutput> Children { get; set; } |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits.Dto; |
|||
|
|||
public class UpdateOrganizationUnitInput |
|||
{ |
|||
[Required] public string DisplayName { get; set; } |
|||
|
|||
public Guid Id { get; set; } |
|||
} |
|||
@ -1,66 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits; |
|||
|
|||
public interface IOrganizationUnitAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 获取组织机构树结构
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task<List<TreeOutput>> GetTreeAsync(); |
|||
|
|||
/// <summary>
|
|||
/// 创建组织机构
|
|||
/// </summary>
|
|||
Task CreateAsync(CreateOrganizationUnitInput input); |
|||
|
|||
/// <summary>
|
|||
/// 删除组织机构
|
|||
/// </summary>
|
|||
Task DeleteAsync(IdInput input); |
|||
|
|||
/// <summary>
|
|||
/// 编辑组织机构
|
|||
/// </summary>
|
|||
Task UpdateAsync(UpdateOrganizationUnitInput input); |
|||
|
|||
/// <summary>
|
|||
/// 向组织机构添加角色
|
|||
/// </summary>
|
|||
Task AddRoleToOrganizationUnitAsync(AddRoleToOrganizationUnitInput input); |
|||
|
|||
/// <summary>
|
|||
/// 向组织机构删除角色
|
|||
/// </summary>
|
|||
Task RemoveRoleFromOrganizationUnitAsync(RemoveRoleToOrganizationUnitInput input); |
|||
|
|||
/// <summary>
|
|||
/// 向组织机构添加用户
|
|||
/// </summary>
|
|||
Task AddUserToOrganizationUnitAsync(AddUserToOrganizationUnitInput input); |
|||
|
|||
/// <summary>
|
|||
/// 向组织机构删除用户
|
|||
/// </summary>
|
|||
Task RemoveUserFromOrganizationUnitAsync(RemoveUserToOrganizationUnitInput input); |
|||
|
|||
/// <summary>
|
|||
/// 分页获取组织机构下用户
|
|||
/// </summary>
|
|||
Task<PagedResultDto<GetOrganizationUnitUserOutput>> GetUsersAsync(GetOrganizationUnitUserInput input); |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 分页获取组织机构下角色
|
|||
/// </summary>
|
|||
Task<PagedResultDto<GetOrganizationUnitRoleOutput>> GetRolesAsync(GetOrganizationUnitRoleInput input); |
|||
|
|||
/// <summary>
|
|||
/// 获取不在组织机构的用户
|
|||
/// </summary>
|
|||
Task<PagedResultDto<GetUnAddUserOutput>> GetUnAddUsersAsync(GetUnAddUserInput input); |
|||
|
|||
/// <summary>
|
|||
/// 获取不在组织机构的角色
|
|||
/// </summary>
|
|||
Task<PagedResultDto<GetUnAddRoleOutput>> GetUnAddRolessAsync(GetUnAddRoleInput input); |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles.Dtos |
|||
{ |
|||
public class GetPermissionInput |
|||
{ |
|||
[Required] |
|||
public string ProviderName { get; set; } |
|||
[Required] |
|||
public string ProviderKey { get; set; } |
|||
} |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles.Dtos |
|||
{ |
|||
public class PagingRoleListInput : PagingBase |
|||
{ |
|||
public string Filter { get; set; } |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles.Dtos |
|||
{ |
|||
public class PermissionOutput { |
|||
public List<string> Grants { get; set; } = new List<string>(); |
|||
|
|||
public List<string> AllGrants { get; set; } = new List<string>(); |
|||
|
|||
public List<PermissionTreeDto> Permissions { get; set; } = new List<PermissionTreeDto>(); |
|||
} |
|||
|
|||
public class PermissionTreeDto |
|||
{ |
|||
public string Title { get; set; } |
|||
|
|||
public string Key { get; set; } |
|||
|
|||
public List<PermissionTreeDto> Children { get; set; }=new List<PermissionTreeDto>(); |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles.Dtos |
|||
{ |
|||
public class UpdateRoleInput |
|||
{ |
|||
public Guid RoleId { get; set; } |
|||
|
|||
public IdentityRoleUpdateDto RoleInfo { get; set; } |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles.Dtos |
|||
{ |
|||
public class UpdateRolePermissionsInput |
|||
{ |
|||
[Required] |
|||
public string ProviderName { get; set; } |
|||
|
|||
[Required] |
|||
public string ProviderKey { get; set; } |
|||
|
|||
public UpdatePermissionsDto UpdatePermissionsDto { get; set; } |
|||
} |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles |
|||
{ |
|||
public interface IRoleAppService : IApplicationService |
|||
{ |
|||
Task<ListResultDto<IdentityRoleDto>> AllListAsync(); |
|||
|
|||
Task<PagedResultDto<IdentityRoleDto>> ListAsync(PagingRoleListInput input); |
|||
|
|||
Task<IdentityRoleDto> CreateAsync(IdentityRoleCreateDto input); |
|||
|
|||
Task<IdentityRoleDto> UpdateAsync(UpdateRoleInput input); |
|||
|
|||
Task DeleteAsync(IdInput input); |
|||
|
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles |
|||
{ |
|||
public interface IRolePermissionAppService : IApplicationService |
|||
{ |
|||
|
|||
Task<PermissionOutput> GetPermissionAsync(GetPermissionInput input); |
|||
|
|||
Task UpdatePermissionAsync(UpdateRolePermissionsInput input); |
|||
} |
|||
} |
|||
@ -1,25 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles; |
|||
|
|||
public class PermissionOptions |
|||
{ |
|||
/// <summary>
|
|||
/// 需要排除的权限
|
|||
/// </summary>
|
|||
public List<string> Excludes { get; } |
|||
|
|||
public PermissionOptions() |
|||
{ |
|||
Excludes = new List<string>(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 权限是否排除
|
|||
/// </summary>
|
|||
/// <param name="permission">权限名称</param>
|
|||
/// <returns>bool</returns>
|
|||
public bool IsExclude(string permission) |
|||
{ |
|||
if (permission.IsNullOrWhiteSpace()) return false; |
|||
return Excludes.Any(e => e.ToLower() == permission.ToLower()); |
|||
} |
|||
} |
|||
@ -1,59 +0,0 @@ |
|||
namespace Lion.AbpPro.Settings.Dtos |
|||
{ |
|||
public class SettingOutput |
|||
{ |
|||
/// <summary>
|
|||
/// 分组
|
|||
/// </summary>
|
|||
public string Group { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 分组显示名称
|
|||
/// </summary>
|
|||
public string GroupDisplayName { get; set; } |
|||
|
|||
public List<SettingItemOutput> SettingItemOutput { get; set; } |
|||
|
|||
public SettingOutput() |
|||
{ |
|||
SettingItemOutput = new List<SettingItemOutput>(); |
|||
} |
|||
} |
|||
|
|||
public class SettingItemOutput |
|||
{ |
|||
public SettingItemOutput(string name, string displayName, string value, string type,string description) |
|||
{ |
|||
Name = name; |
|||
DisplayName = displayName; |
|||
Value = value; |
|||
Type = type ?? "Text"; |
|||
Description = description; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 名称
|
|||
/// </summary>
|
|||
public string Name { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 显示名称
|
|||
/// </summary>
|
|||
public string DisplayName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 描述
|
|||
/// </summary>
|
|||
public string Description { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 值
|
|||
/// </summary>
|
|||
public string Value { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 前端控件类型
|
|||
/// </summary>
|
|||
public string Type { get; set; } |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
namespace Lion.AbpPro.Settings.Dtos |
|||
{ |
|||
public class UpdateSettingInput |
|||
{ |
|||
public Dictionary<string, string> Values { get; set; } |
|||
|
|||
public UpdateSettingInput() |
|||
{ |
|||
Values = new Dictionary<string, string>(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
namespace Lion.AbpPro.Settings |
|||
{ |
|||
public interface ISettingAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 获取setting信息
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task<List<SettingOutput>> GetAsync(); |
|||
|
|||
/// <summary>
|
|||
/// 更新setting
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task UpdateAsync(UpdateSettingInput input); |
|||
} |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
namespace Lion.AbpPro.Tenants.Dtos |
|||
{ |
|||
public class FindTenantByNameInput |
|||
{ |
|||
public string Name { get; set; } |
|||
} |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
namespace Lion.AbpPro.Tenants.Dtos |
|||
{ |
|||
public class PagingTenantInput : PagingBase |
|||
{ |
|||
public string Filter { get; set; } |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace Lion.AbpPro.Tenants.Dtos |
|||
{ |
|||
public class UpdateConnectionStringInput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
[Required(ErrorMessage = "连接字符串不能为空")] public string ConnectionString { get; set; } |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
namespace Lion.AbpPro.Tenants.Dtos |
|||
{ |
|||
public class UpdateTenantInput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
[Required(ErrorMessage = "租户名称不能为空")] public string Name { get; set; } |
|||
} |
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
namespace Lion.AbpPro.Tenants |
|||
{ |
|||
public interface IVoloTenantAppService : IApplicationService |
|||
{ |
|||
Task<FindTenantResultDto> FindTenantByNameAsync(FindTenantByNameInput input); |
|||
|
|||
Task<PagedResultDto<TenantDto>> ListAsync(PagingTenantInput input); |
|||
|
|||
Task<TenantDto> CreateAsync(TenantCreateDto input); |
|||
|
|||
Task<TenantDto> UpdateAsync(UpdateTenantInput input); |
|||
|
|||
Task DeleteAsync(IdInput input); |
|||
|
|||
Task<string> GetDefaultConnectionStringAsync(IdInput input); |
|||
|
|||
Task UpdateDefaultConnectionStringAsync(UpdateConnectionStringInput input); |
|||
|
|||
Task DeleteDefaultConnectionStringAsync(IdInput input); |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
public class ExportIdentityUserOutput |
|||
{ |
|||
[ExporterHeader(DisplayName = "用户名")] public string UserName { get; set; } |
|||
|
|||
[ExporterHeader(DisplayName = "真实名称")] public string Name { get; set; } |
|||
|
|||
[ExporterHeader(DisplayName = "邮箱")] public string Email { get; set; } |
|||
|
|||
[ExporterHeader(DisplayName = "手机号码")] public string PhoneNumber { get; set; } |
|||
|
|||
[ExporterHeader(IsIgnore = true)] public bool IsActive { get; set; } |
|||
|
|||
|
|||
[ExporterHeader(DisplayName = "状态")] public string Status => IsActive ? "启用" : "禁用"; |
|||
|
|||
[ExporterHeader(IsIgnore = true)] public DateTime CreationTime { get; set; } |
|||
|
|||
[ExporterHeader(DisplayName = "创建时间")] |
|||
public string CreationTimeFormat => CreationTime.ToString("yyyy-MM-dd hh:mm:ss"); |
|||
} |
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos; |
|||
|
|||
public class GithubAccessTokenResponse |
|||
{ |
|||
/// <summary>
|
|||
/// access_token
|
|||
/// </summary>
|
|||
[JsonProperty("access_token")] |
|||
public string Access_token { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// scope
|
|||
/// </summary>
|
|||
[JsonProperty("scope")] |
|||
public string Scope { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// token_type
|
|||
/// </summary>
|
|||
[JsonProperty("token_type")] |
|||
public string TokenType { get; set; } |
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
public class LockUserInput |
|||
{ |
|||
[Required] |
|||
public Guid UserId { get; set; } |
|||
|
|||
[Required] |
|||
public bool Locked { get; set; } |
|||
} |
|||
} |
|||
@ -1,99 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos; |
|||
|
|||
public class LoginGithubResponse |
|||
{ |
|||
public string login { get; set; } |
|||
|
|||
|
|||
public int id { get; set; } |
|||
|
|||
|
|||
public string node_id { get; set; } |
|||
|
|||
|
|||
public string avatar_url { get; set; } |
|||
|
|||
|
|||
public string gravatar_id { get; set; } |
|||
|
|||
|
|||
public string url { get; set; } |
|||
|
|||
|
|||
public string html_url { get; set; } |
|||
|
|||
|
|||
public string followers_url { get; set; } |
|||
|
|||
|
|||
public string following_url { get; set; } |
|||
|
|||
|
|||
public string gists_url { get; set; } |
|||
|
|||
|
|||
public string starred_url { get; set; } |
|||
|
|||
|
|||
public string subscriptions_url { get; set; } |
|||
|
|||
|
|||
public string organizations_url { get; set; } |
|||
|
|||
|
|||
public string repos_url { get; set; } |
|||
|
|||
|
|||
public string events_url { get; set; } |
|||
|
|||
|
|||
public string received_events_url { get; set; } |
|||
|
|||
|
|||
public string type { get; set; } |
|||
|
|||
|
|||
public string site_admin { get; set; } |
|||
|
|||
|
|||
public string name { get; set; } |
|||
|
|||
|
|||
public string company { get; set; } |
|||
|
|||
|
|||
public string blog { get; set; } |
|||
|
|||
|
|||
public string location { get; set; } |
|||
|
|||
|
|||
public string email { get; set; } |
|||
|
|||
|
|||
public string hireable { get; set; } |
|||
|
|||
|
|||
public string bio { get; set; } |
|||
|
|||
|
|||
public string twitter_username { get; set; } |
|||
|
|||
|
|||
public int public_repos { get; set; } |
|||
|
|||
|
|||
public int public_gists { get; set; } |
|||
|
|||
|
|||
public int followers { get; set; } |
|||
|
|||
|
|||
public int following { get; set; } |
|||
|
|||
|
|||
public string created_at { get; set; } |
|||
|
|||
|
|||
public string updated_at { get; set; } |
|||
} |
|||
@ -1,33 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
/// <summary>
|
|||
/// 登录
|
|||
/// </summary>
|
|||
public class LoginInput : IValidatableObject |
|||
{ |
|||
/// <summary>
|
|||
/// 用户名或者邮箱
|
|||
/// </summary>
|
|||
public string Name { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 密码
|
|||
/// </summary>
|
|||
[DisableAuditing] |
|||
public string Password { get; set; } |
|||
|
|||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) |
|||
{ |
|||
if (Name.IsNullOrWhiteSpace()) |
|||
{ |
|||
yield return new ValidationResult("Email can not be null", new[] { "Email" }); |
|||
} |
|||
|
|||
if (Password.IsNullOrWhiteSpace()) |
|||
{ |
|||
yield return new ValidationResult("Password can not be null", new[] { "Password" }); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
public class LoginOutput |
|||
{ |
|||
public Guid Id { get; set; } |
|||
|
|||
public string Name { get; set; } |
|||
|
|||
public string UserName { get; set; } |
|||
|
|||
public string Token { get; set; } |
|||
|
|||
public List<string> Roles { get; set; } = new List<string>(); |
|||
} |
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
public class LoginStsResponse |
|||
{ |
|||
public string name { get; set; } |
|||
|
|||
public string preferred_username { get; set; } |
|||
|
|||
public string family_name { get; set; } |
|||
|
|||
public string email { get; set; } |
|||
|
|||
public string given_name { get; set; } |
|||
|
|||
public string avatar { get; set; } |
|||
|
|||
public string sub { get; set; } |
|||
|
|||
public Guid? tenantId { get; set; } |
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
public class PagingUserListInput : PagingBase |
|||
{ |
|||
/// <summary>
|
|||
/// 关键字
|
|||
/// </summary>
|
|||
public string Filter { get; set; } |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Dtos |
|||
{ |
|||
public class UpdateUserInput |
|||
{ |
|||
public Guid UserId { get; set; } |
|||
|
|||
public IdentityUserUpdateDto UserInfo { get; set; } |
|||
} |
|||
} |
|||
@ -1,12 +0,0 @@ |
|||
namespace Lion.AbpPro.Users |
|||
{ |
|||
public interface IAccountAppService: IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 用户名密码登录
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<LoginOutput> LoginAsync(LoginInput input); |
|||
} |
|||
} |
|||
@ -1,58 +0,0 @@ |
|||
namespace Lion.AbpPro.Users |
|||
{ |
|||
public interface IUserAppService : IApplicationService |
|||
{ |
|||
/// <summary>
|
|||
/// 分页查询用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<PagedResultDto<IdentityUserDto>> ListAsync(PagingUserListInput input); |
|||
|
|||
/// <summary>
|
|||
/// 用户导出列表
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task<ActionResult> ExportAsync(PagingUserListInput input); |
|||
|
|||
/// <summary>
|
|||
/// 新增用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input); |
|||
|
|||
/// <summary>
|
|||
/// 更新用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<IdentityUserDto> UpdateAsync(UpdateUserInput input); |
|||
|
|||
/// <summary>
|
|||
/// 删除用户
|
|||
/// </summary>
|
|||
Task DeleteAsync(IdInput input); |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 获取用户角色信息
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task<ListResultDto<IdentityRoleDto>> GetRoleByUserId(IdInput input); |
|||
|
|||
/// <summary>
|
|||
/// 修改密码
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<bool> ChangePasswordAsync(ChangePasswordInput input); |
|||
|
|||
/// <summary>
|
|||
/// 锁定用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task LockAsync(LockUserInput input); |
|||
} |
|||
} |
|||
@ -1,349 +0,0 @@ |
|||
using System.Globalization; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; |
|||
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Features; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Timing; |
|||
|
|||
namespace Lion.AbpPro.ApplicationConfigurations; |
|||
|
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
public class LionAbpApplicationConfigurationAppService : ApplicationService, IAbpApplicationConfigurationAppService |
|||
{ |
|||
private readonly AbpLocalizationOptions _localizationOptions; |
|||
private readonly AbpMultiTenancyOptions _multiTenancyOptions; |
|||
private readonly IServiceProvider _serviceProvider; |
|||
private readonly IAbpAuthorizationPolicyProvider _abpAuthorizationPolicyProvider; |
|||
private readonly IPermissionDefinitionManager _permissionDefinitionManager; |
|||
private readonly DefaultAuthorizationPolicyProvider _defaultAuthorizationPolicyProvider; |
|||
private readonly IPermissionChecker _permissionChecker; |
|||
private readonly IAuthorizationService _authorizationService; |
|||
private readonly ICurrentUser _currentUser; |
|||
private readonly ISettingProvider _settingProvider; |
|||
private readonly ISettingDefinitionManager _settingDefinitionManager; |
|||
private readonly IFeatureDefinitionManager _featureDefinitionManager; |
|||
private readonly ILanguageProvider _languageProvider; |
|||
private readonly ITimezoneProvider _timezoneProvider; |
|||
private readonly AbpClockOptions _abpClockOptions; |
|||
private readonly ICachedObjectExtensionsDtoService _cachedObjectExtensionsDtoService; |
|||
|
|||
public LionAbpApplicationConfigurationAppService( |
|||
IOptions<AbpLocalizationOptions> localizationOptions, |
|||
IOptions<AbpMultiTenancyOptions> multiTenancyOptions, |
|||
IServiceProvider serviceProvider, |
|||
IAbpAuthorizationPolicyProvider abpAuthorizationPolicyProvider, |
|||
IPermissionDefinitionManager permissionDefinitionManager, |
|||
DefaultAuthorizationPolicyProvider defaultAuthorizationPolicyProvider, |
|||
IPermissionChecker permissionChecker, |
|||
IAuthorizationService authorizationService, |
|||
ICurrentUser currentUser, |
|||
ISettingProvider settingProvider, |
|||
ISettingDefinitionManager settingDefinitionManager, |
|||
IFeatureDefinitionManager featureDefinitionManager, |
|||
ILanguageProvider languageProvider, |
|||
ITimezoneProvider timezoneProvider, |
|||
IOptions<AbpClockOptions> abpClockOptions, |
|||
ICachedObjectExtensionsDtoService cachedObjectExtensionsDtoService) |
|||
{ |
|||
_serviceProvider = serviceProvider; |
|||
_abpAuthorizationPolicyProvider = abpAuthorizationPolicyProvider; |
|||
_permissionDefinitionManager = permissionDefinitionManager; |
|||
_defaultAuthorizationPolicyProvider = defaultAuthorizationPolicyProvider; |
|||
_permissionChecker = permissionChecker; |
|||
_authorizationService = authorizationService; |
|||
_currentUser = currentUser; |
|||
_settingProvider = settingProvider; |
|||
_settingDefinitionManager = settingDefinitionManager; |
|||
_featureDefinitionManager = featureDefinitionManager; |
|||
_languageProvider = languageProvider; |
|||
_timezoneProvider = timezoneProvider; |
|||
_abpClockOptions = abpClockOptions.Value; |
|||
_cachedObjectExtensionsDtoService = cachedObjectExtensionsDtoService; |
|||
_localizationOptions = localizationOptions.Value; |
|||
_multiTenancyOptions = multiTenancyOptions.Value; |
|||
} |
|||
|
|||
public virtual async Task<ApplicationConfigurationDto> GetAsync() |
|||
{ |
|||
//TODO: Optimize & cache..?
|
|||
|
|||
Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetAsync()..."); |
|||
|
|||
var result = new ApplicationConfigurationDto |
|||
{ |
|||
Auth = await GetAuthConfigAsync(), |
|||
Features = await GetFeaturesConfigAsync(), |
|||
Localization = await GetLocalizationConfigAsync(), |
|||
CurrentUser = GetCurrentUser(), |
|||
Setting = await GetSettingConfigAsync(), |
|||
MultiTenancy = GetMultiTenancy(), |
|||
CurrentTenant = GetCurrentTenant(), |
|||
Timing = await GetTimingConfigAsync(), |
|||
Clock = GetClockConfig(), |
|||
ObjectExtensions = _cachedObjectExtensionsDtoService.Get() |
|||
}; |
|||
|
|||
Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetAsync()."); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
protected virtual CurrentTenantDto GetCurrentTenant() |
|||
{ |
|||
return new CurrentTenantDto() |
|||
{ |
|||
Id = CurrentTenant.Id, |
|||
Name = CurrentTenant.Name, |
|||
IsAvailable = CurrentTenant.IsAvailable |
|||
}; |
|||
} |
|||
|
|||
protected virtual MultiTenancyInfoDto GetMultiTenancy() |
|||
{ |
|||
return new MultiTenancyInfoDto |
|||
{ |
|||
IsEnabled = _multiTenancyOptions.IsEnabled |
|||
}; |
|||
} |
|||
|
|||
protected virtual CurrentUserDto GetCurrentUser() |
|||
{ |
|||
return new CurrentUserDto |
|||
{ |
|||
IsAuthenticated = _currentUser.IsAuthenticated, |
|||
Id = _currentUser.Id, |
|||
TenantId = _currentUser.TenantId, |
|||
ImpersonatorUserId = _currentUser.FindImpersonatorUserId(), |
|||
ImpersonatorTenantId = _currentUser.FindImpersonatorTenantId(), |
|||
UserName = _currentUser.UserName, |
|||
SurName = _currentUser.SurName, |
|||
Name = _currentUser.Name, |
|||
Email = _currentUser.Email, |
|||
EmailVerified = _currentUser.EmailVerified, |
|||
PhoneNumber = _currentUser.PhoneNumber, |
|||
PhoneNumberVerified = _currentUser.PhoneNumberVerified, |
|||
Roles = _currentUser.Roles |
|||
}; |
|||
} |
|||
|
|||
protected virtual async Task<ApplicationAuthConfigurationDto> GetAuthConfigAsync() |
|||
{ |
|||
var authConfig = new ApplicationAuthConfigurationDto(); |
|||
|
|||
var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync(); |
|||
var abpPolicyNames = new List<string>(); |
|||
var otherPolicyNames = new List<string>(); |
|||
|
|||
foreach (var policyName in policyNames) |
|||
{ |
|||
if (await _defaultAuthorizationPolicyProvider.GetPolicyAsync(policyName) == null && _permissionDefinitionManager.GetOrNull(policyName) != null) |
|||
{ |
|||
abpPolicyNames.Add(policyName); |
|||
} |
|||
else |
|||
{ |
|||
otherPolicyNames.Add(policyName); |
|||
} |
|||
} |
|||
|
|||
foreach (var policyName in otherPolicyNames) |
|||
{ |
|||
authConfig.Policies[policyName] = true; |
|||
|
|||
if (await _authorizationService.IsGrantedAsync(policyName)) |
|||
{ |
|||
authConfig.GrantedPolicies[policyName] = true; |
|||
} |
|||
} |
|||
|
|||
var result = await _permissionChecker.IsGrantedAsync(abpPolicyNames.ToArray()); |
|||
foreach (var (key, value) in result.Result) |
|||
{ |
|||
authConfig.Policies[key] = true; |
|||
if (value == PermissionGrantResult.Granted) |
|||
{ |
|||
authConfig.GrantedPolicies[key] = true; |
|||
} |
|||
} |
|||
|
|||
var policies = BuildGrantedPolicies(authConfig.GrantedPolicies.Select(e => e.Key).ToList()); |
|||
foreach (var item in policies) |
|||
{ |
|||
if (authConfig.GrantedPolicies.Any(e => e.Key == item)) continue; |
|||
authConfig.GrantedPolicies.Add(item, true); |
|||
} |
|||
return authConfig; |
|||
} |
|||
|
|||
private List<string> BuildGrantedPolicies(List<string> grantedPolicies) |
|||
{ |
|||
var result = new List<string>(); |
|||
foreach (var policy in grantedPolicies) |
|||
{ |
|||
result.AddRange(GetPolicy(policy)); |
|||
} |
|||
|
|||
return result.Distinct().ToList(); |
|||
} |
|||
|
|||
private List<string> GetPolicy(string policy) |
|||
{ |
|||
var result = new List<string>(); |
|||
var split = policy.Split('.', StringSplitOptions.RemoveEmptyEntries); |
|||
if (split.Length <= 0) return result; |
|||
var currentPolicy = string.Empty; |
|||
for (int i = 0; i < split.Length - 1; i++) |
|||
{ |
|||
if (i == 0) |
|||
{ |
|||
currentPolicy += split[i]; |
|||
} |
|||
else |
|||
{ |
|||
currentPolicy += "." + split[i]; |
|||
} |
|||
} |
|||
|
|||
if (!currentPolicy.IsNullOrWhiteSpace()) |
|||
{ |
|||
result.Add(currentPolicy); |
|||
result.AddRange(GetPolicy(currentPolicy)); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
|
|||
protected virtual async Task<ApplicationLocalizationConfigurationDto> GetLocalizationConfigAsync() |
|||
{ |
|||
var localizationConfig = new ApplicationLocalizationConfigurationDto(); |
|||
|
|||
localizationConfig.Languages.AddRange(await _languageProvider.GetLanguagesAsync()); |
|||
|
|||
foreach (var resource in _localizationOptions.Resources.Values) |
|||
{ |
|||
var dictionary = new Dictionary<string, string>(); |
|||
|
|||
var localizer = _serviceProvider.GetRequiredService( |
|||
typeof(IStringLocalizer<>).MakeGenericType(resource.ResourceType) |
|||
) as IStringLocalizer; |
|||
|
|||
foreach (var localizedString in localizer.GetAllStrings()) |
|||
{ |
|||
dictionary[localizedString.Name] = localizedString.Value; |
|||
} |
|||
|
|||
localizationConfig.Values[resource.ResourceName] = dictionary; |
|||
} |
|||
|
|||
localizationConfig.CurrentCulture = GetCurrentCultureInfo(); |
|||
|
|||
if (_localizationOptions.DefaultResourceType != null) |
|||
{ |
|||
localizationConfig.DefaultResourceName = LocalizationResourceNameAttribute.GetName( |
|||
_localizationOptions.DefaultResourceType |
|||
); |
|||
} |
|||
|
|||
localizationConfig.LanguagesMap = _localizationOptions.LanguagesMap; |
|||
localizationConfig.LanguageFilesMap = _localizationOptions.LanguageFilesMap; |
|||
|
|||
return localizationConfig; |
|||
} |
|||
|
|||
private static CurrentCultureDto GetCurrentCultureInfo() |
|||
{ |
|||
return new CurrentCultureDto |
|||
{ |
|||
Name = CultureInfo.CurrentUICulture.Name, |
|||
DisplayName = CultureInfo.CurrentUICulture.DisplayName, |
|||
EnglishName = CultureInfo.CurrentUICulture.EnglishName, |
|||
NativeName = CultureInfo.CurrentUICulture.NativeName, |
|||
IsRightToLeft = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft, |
|||
CultureName = CultureInfo.CurrentUICulture.TextInfo.CultureName, |
|||
TwoLetterIsoLanguageName = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, |
|||
ThreeLetterIsoLanguageName = CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName, |
|||
DateTimeFormat = new DateTimeFormatDto |
|||
{ |
|||
CalendarAlgorithmType = |
|||
CultureInfo.CurrentUICulture.DateTimeFormat.Calendar.AlgorithmType.ToString(), |
|||
DateTimeFormatLong = CultureInfo.CurrentUICulture.DateTimeFormat.LongDatePattern, |
|||
ShortDatePattern = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern, |
|||
FullDateTimePattern = CultureInfo.CurrentUICulture.DateTimeFormat.FullDateTimePattern, |
|||
DateSeparator = CultureInfo.CurrentUICulture.DateTimeFormat.DateSeparator, |
|||
ShortTimePattern = CultureInfo.CurrentUICulture.DateTimeFormat.ShortTimePattern, |
|||
LongTimePattern = CultureInfo.CurrentUICulture.DateTimeFormat.LongTimePattern, |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private async Task<ApplicationSettingConfigurationDto> GetSettingConfigAsync() |
|||
{ |
|||
var result = new ApplicationSettingConfigurationDto |
|||
{ |
|||
Values = new Dictionary<string, string>() |
|||
}; |
|||
|
|||
var settingDefinitions = _settingDefinitionManager.GetAll().Where(x => x.IsVisibleToClients); |
|||
|
|||
var settingValues = await _settingProvider.GetAllAsync(settingDefinitions.Select(x => x.Name).ToArray()); |
|||
|
|||
foreach (var settingValue in settingValues) |
|||
{ |
|||
result.Values[settingValue.Name] = settingValue.Value; |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
protected virtual async Task<ApplicationFeatureConfigurationDto> GetFeaturesConfigAsync() |
|||
{ |
|||
var result = new ApplicationFeatureConfigurationDto(); |
|||
|
|||
foreach (var featureDefinition in _featureDefinitionManager.GetAll()) |
|||
{ |
|||
if (!featureDefinition.IsVisibleToClients) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
result.Values[featureDefinition.Name] = await FeatureChecker.GetOrNullAsync(featureDefinition.Name); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
protected virtual async Task<TimingDto> GetTimingConfigAsync() |
|||
{ |
|||
var windowsTimeZoneId = await _settingProvider.GetOrNullAsync(TimingSettingNames.TimeZone); |
|||
|
|||
return new TimingDto |
|||
{ |
|||
TimeZone = new Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone |
|||
{ |
|||
Windows = new WindowsTimeZone |
|||
{ |
|||
TimeZoneId = windowsTimeZoneId |
|||
}, |
|||
Iana = new IanaTimeZone |
|||
{ |
|||
TimeZoneName = windowsTimeZoneId.IsNullOrWhiteSpace() |
|||
? null |
|||
: _timezoneProvider.WindowsToIana(windowsTimeZoneId) |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
|
|||
protected virtual ClockDto GetClockConfig() |
|||
{ |
|||
return new ClockDto |
|||
{ |
|||
Kind = Enum.GetName(typeof(DateTimeKind), _abpClockOptions.Kind) |
|||
}; |
|||
} |
|||
} |
|||
@ -1,54 +0,0 @@ |
|||
namespace Lion.AbpPro.AuditLogs |
|||
{ |
|||
[Authorize] |
|||
public class AuditLogAppService : AbpProAppService, IAuditLogAppService |
|||
{ |
|||
private readonly IAuditLogRepository _auditLogRepository; |
|||
|
|||
public AuditLogAppService(IAuditLogRepository auditLogRepository) |
|||
{ |
|||
_auditLogRepository = auditLogRepository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 分页查询审计日志
|
|||
/// </summary>
|
|||
[Authorize(Policy = AbpProPermissions.SystemManagement.AuditLog)] |
|||
public async Task<PagedResultDto<GetAuditLogPageListOutput>> GetListAsync(PagingAuditLogListInput input) |
|||
{ |
|||
var list = await _auditLogRepository.GetListAsync( |
|||
input.Sorting, |
|||
input.PageSize, |
|||
input.SkipCount, |
|||
input.StartTime?.Date, |
|||
input.EndTime?.Date, |
|||
input.HttpMethod, |
|||
input.Url, |
|||
null, |
|||
input.UserName, |
|||
input.ApplicationName, |
|||
input.CorrelationId, |
|||
null, |
|||
input.MaxExecutionDuration, |
|||
input.MinExecutionDuration, |
|||
input.HasException, |
|||
input.HttpStatusCode); |
|||
var totalCount = await _auditLogRepository.GetCountAsync( |
|||
input.StartTime?.Date, |
|||
input.EndTime?.Date, |
|||
input.HttpMethod, |
|||
input.Url, |
|||
null, |
|||
input.UserName, |
|||
input.ApplicationName, |
|||
null, |
|||
input.CorrelationId, |
|||
input.MaxExecutionDuration, |
|||
input.MinExecutionDuration, |
|||
input.HasException, |
|||
input.HttpStatusCode); |
|||
return new PagedResultDto<GetAuditLogPageListOutput>(totalCount, |
|||
ObjectMapper.Map<List<AuditLog>, List<GetAuditLogPageListOutput>>(list)); |
|||
} |
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.AuditLogs.Mappers |
|||
{ |
|||
public class AuditLogApplicationAutoMapperProfile:Profile |
|||
{ |
|||
public AuditLogApplicationAutoMapperProfile() |
|||
{ |
|||
CreateMap<AuditLog, GetAuditLogPageListOutput>(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,198 +0,0 @@ |
|||
namespace Lion.AbpPro.OrganizationUnits; |
|||
|
|||
[Authorize] |
|||
public class OrganizationUnitAppService : AbpProAppService, IOrganizationUnitAppService |
|||
{ |
|||
private readonly OrganizationUnitManager _organizationUnitManager; |
|||
private readonly IdentityUserManager _identityUserManager; |
|||
private readonly IOrganizationUnitRepository _organizationUnitRepository; |
|||
|
|||
public OrganizationUnitAppService( |
|||
OrganizationUnitManager OrganizationUnitManager, |
|||
IdentityUserManager identityUserManager, |
|||
IOrganizationUnitRepository organizationUnitRepository) |
|||
{ |
|||
_organizationUnitManager = OrganizationUnitManager; |
|||
_identityUserManager = identityUserManager; |
|||
_organizationUnitRepository = organizationUnitRepository; |
|||
} |
|||
|
|||
public async Task<List<TreeOutput>> GetTreeAsync() |
|||
{ |
|||
var organizationUnits = await _organizationUnitRepository.GetListAsync(); |
|||
var organizationUnitDtos = ObjectMapper.Map<List<OrganizationUnit>, List<OrganizationUnitDto>>(organizationUnits); |
|||
return ConvertToTree(organizationUnitDtos); |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Create)] |
|||
public async Task CreateAsync(CreateOrganizationUnitInput input) |
|||
{ |
|||
var entity = new OrganizationUnit |
|||
( |
|||
GuidGenerator.Create(), |
|||
input.DisplayName, |
|||
input.ParentId, |
|||
CurrentTenant.Id |
|||
); |
|||
await _organizationUnitManager.CreateAsync(entity); |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Delete)] |
|||
public Task DeleteAsync(IdInput input) |
|||
{ |
|||
return _organizationUnitManager.DeleteAsync(input.Id); |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Update)] |
|||
public async Task UpdateAsync(UpdateOrganizationUnitInput input) |
|||
{ |
|||
var entity = await _organizationUnitRepository.FindAsync(input.Id); |
|||
if (entity != null) |
|||
{ |
|||
entity.DisplayName = input.DisplayName; |
|||
await _organizationUnitManager.UpdateAsync(entity); |
|||
} |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Create)] |
|||
public async Task AddRoleToOrganizationUnitAsync(AddRoleToOrganizationUnitInput input) |
|||
{ |
|||
foreach (var roleId in input.RoleId) |
|||
{ |
|||
await _organizationUnitManager.AddRoleToOrganizationUnitAsync(roleId, input.OrganizationUnitId); |
|||
} |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Delete)] |
|||
public async Task RemoveRoleFromOrganizationUnitAsync(RemoveRoleToOrganizationUnitInput input) |
|||
{ |
|||
await _organizationUnitManager.RemoveRoleFromOrganizationUnitAsync(input.RoleId, input.OrganizationUnitId); |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Create)] |
|||
public async Task AddUserToOrganizationUnitAsync(AddUserToOrganizationUnitInput input) |
|||
{ |
|||
foreach (var userId in input.UserId) |
|||
{ |
|||
await _identityUserManager.AddToOrganizationUnitAsync(userId, input.OrganizationUnitId); |
|||
} |
|||
} |
|||
|
|||
[Authorize(AbpProPermissions.SystemManagement.OrganizationUnitManagement.Delete)] |
|||
public async Task RemoveUserFromOrganizationUnitAsync(RemoveUserToOrganizationUnitInput input) |
|||
{ |
|||
await _identityUserManager.RemoveFromOrganizationUnitAsync(input.UserId, input.OrganizationUnitId); |
|||
} |
|||
|
|||
public async Task<PagedResultDto<GetOrganizationUnitUserOutput>> GetUsersAsync(GetOrganizationUnitUserInput input) |
|||
{ |
|||
var listResult = new List<GetOrganizationUnitUserOutput>(); |
|||
var organizationUnit = await _organizationUnitRepository.FindAsync(input.OrganizationUnitId); |
|||
if (organizationUnit == null) throw new BusinessException(AbpProDomainErrorCodes.OrganizationUnitNotExist); |
|||
|
|||
var count = await _organizationUnitRepository.GetMembersCountAsync(organizationUnit, filter: input.Filter); |
|||
if (count > 0) |
|||
{ |
|||
var list = await _organizationUnitRepository.GetMembersAsync |
|||
( |
|||
organizationUnit, |
|||
maxResultCount: input.PageSize, |
|||
skipCount: input.SkipCount, |
|||
filter: input.Filter |
|||
); |
|||
listResult = ObjectMapper.Map<List<IdentityUser>, List<GetOrganizationUnitUserOutput>>(list); |
|||
} |
|||
|
|||
return new PagedResultDto<GetOrganizationUnitUserOutput>(count, listResult); |
|||
} |
|||
|
|||
public async Task<PagedResultDto<GetUnAddUserOutput>> GetUnAddUsersAsync(GetUnAddUserInput input) |
|||
{ |
|||
var listResult = new List<GetUnAddUserOutput>(); |
|||
var organizationUnit = await _organizationUnitRepository.FindAsync(input.OrganizationUnitId); |
|||
if (organizationUnit == null) throw new BusinessException(AbpProDomainErrorCodes.OrganizationUnitNotExist); |
|||
var count = await _organizationUnitRepository.GetUnaddedUsersCountAsync(organizationUnit, input.Filter); |
|||
if (count > 0) |
|||
{ |
|||
var users = await _organizationUnitRepository.GetUnaddedUsersAsync |
|||
( |
|||
organizationUnit, |
|||
maxResultCount: input.PageSize, |
|||
skipCount: input.SkipCount, |
|||
filter: input.Filter |
|||
); |
|||
listResult = ObjectMapper.Map<List<IdentityUser>, List<GetUnAddUserOutput>>(users); |
|||
} |
|||
|
|||
return new PagedResultDto<GetUnAddUserOutput>(count, listResult); |
|||
} |
|||
|
|||
public async Task<PagedResultDto<GetOrganizationUnitRoleOutput>> GetRolesAsync(GetOrganizationUnitRoleInput input) |
|||
{ |
|||
var listResult = new List<GetOrganizationUnitRoleOutput>(); |
|||
var organizationUnit = await _organizationUnitRepository.FindAsync(input.OrganizationUnitId); |
|||
if (organizationUnit == null) throw new BusinessException(AbpProDomainErrorCodes.OrganizationUnitNotExist); |
|||
|
|||
var count = await _organizationUnitRepository.GetRolesCountAsync(organizationUnit); |
|||
if (count > 0) |
|||
{ |
|||
var list = await _organizationUnitRepository.GetRolesAsync(organizationUnit, maxResultCount: input.PageSize, skipCount: input.SkipCount); |
|||
listResult = ObjectMapper.Map<List<IdentityRole>, List<GetOrganizationUnitRoleOutput>>(list); |
|||
} |
|||
|
|||
return new PagedResultDto<GetOrganizationUnitRoleOutput>(count, listResult); |
|||
} |
|||
|
|||
public async Task<PagedResultDto<GetUnAddRoleOutput>> GetUnAddRolessAsync(GetUnAddRoleInput input) |
|||
{ |
|||
var listResult = new List<GetUnAddRoleOutput>(); |
|||
var organizationUnit = await _organizationUnitRepository.FindAsync(input.OrganizationUnitId); |
|||
if (organizationUnit == null) throw new BusinessException(AbpProDomainErrorCodes.OrganizationUnitNotExist); |
|||
var count = await _organizationUnitRepository.GetUnaddedRolesCountAsync(organizationUnit, input.Filter); |
|||
if (count > 0) |
|||
{ |
|||
var roles = await _organizationUnitRepository.GetUnaddedRolesAsync |
|||
( |
|||
organizationUnit, |
|||
maxResultCount: input.PageSize, |
|||
skipCount: input.SkipCount, |
|||
filter: input.Filter |
|||
); |
|||
listResult = ObjectMapper.Map<List<IdentityRole>, List<GetUnAddRoleOutput>>(roles); |
|||
} |
|||
|
|||
return new PagedResultDto<GetUnAddRoleOutput>(count, listResult); |
|||
} |
|||
|
|||
#region 私有方法
|
|||
|
|||
private List<TreeOutput> ConvertToTree( |
|||
List<OrganizationUnitDto> list, |
|||
Guid? Id = null) |
|||
{ |
|||
var result = new List<TreeOutput>(); |
|||
var childList = Children(list, Id); |
|||
foreach (var item in childList) |
|||
{ |
|||
var tree = new TreeOutput |
|||
{ |
|||
Key = item.Id, |
|||
Title = item.DisplayName, |
|||
Children = ConvertToTree(list, item.Id) |
|||
}; |
|||
result.Add(tree); |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private List<OrganizationUnitDto> Children( |
|||
List<OrganizationUnitDto> list, |
|||
Guid? Id) |
|||
{ |
|||
var childList = list.Where(x => x.ParentId == Id).ToList(); |
|||
return childList; |
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
@ -1,87 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles |
|||
{ |
|||
[Authorize] |
|||
public class RoleAppService : AbpProAppService, IRoleAppService |
|||
{ |
|||
private readonly IIdentityRoleAppService _identityRoleAppService; |
|||
|
|||
private readonly IIdentityRoleRepository _roleRepository; |
|||
|
|||
public RoleAppService( |
|||
IIdentityRoleAppService identityRoleAppService, |
|||
IIdentityRoleRepository roleRepository) |
|||
{ |
|||
_identityRoleAppService = identityRoleAppService; |
|||
|
|||
_roleRepository = roleRepository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取所有角色
|
|||
/// </summary>
|
|||
|
|||
public async Task<ListResultDto<IdentityRoleDto>> AllListAsync() |
|||
{ |
|||
List<IdentityRole> source = |
|||
await _roleRepository.GetListAsync() |
|||
.ConfigureAwait(continueOnCapturedContext: false); |
|||
return new ListResultDto<IdentityRoleDto>( |
|||
base.ObjectMapper.Map<List<IdentityRole>, List<IdentityRoleDto>>(source)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 分页查询角色
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
public async Task<PagedResultDto<IdentityRoleDto>> ListAsync(PagingRoleListInput input) |
|||
{ |
|||
var request = new GetIdentityRolesInput |
|||
{ |
|||
Filter = input.Filter?.Trim(), MaxResultCount = input.PageSize, |
|||
SkipCount = input.SkipCount |
|||
}; |
|||
List<IdentityRole> list = await _roleRepository |
|||
.GetListAsync(request.Sorting, request.MaxResultCount, request.SkipCount, |
|||
request.Filter) |
|||
.ConfigureAwait(continueOnCapturedContext: false); |
|||
return new PagedResultDto<IdentityRoleDto>( |
|||
await _roleRepository.GetCountAsync(request.Filter) |
|||
.ConfigureAwait(continueOnCapturedContext: false), |
|||
base.ObjectMapper.Map<List<IdentityRole>, List<IdentityRoleDto>>(list)); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建角色
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[Authorize(IdentityPermissions.Roles.Create)] |
|||
public async Task<IdentityRoleDto> CreateAsync(IdentityRoleCreateDto input) |
|||
{ |
|||
return await _identityRoleAppService.CreateAsync(input); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 更新角色
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[Authorize(IdentityPermissions.Roles.Update)] |
|||
public async Task<IdentityRoleDto> UpdateAsync(UpdateRoleInput input) |
|||
{ |
|||
return await _identityRoleAppService.UpdateAsync(input.RoleId, input.RoleInfo); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 删除角色
|
|||
/// </summary>
|
|||
[Authorize(IdentityPermissions.Roles.Delete)] |
|||
public async Task DeleteAsync(IdInput input) |
|||
{ |
|||
await _identityRoleAppService.DeleteAsync(input.Id); |
|||
} |
|||
} |
|||
} |
|||
@ -1,117 +0,0 @@ |
|||
namespace Lion.AbpPro.Roles |
|||
{ |
|||
[Authorize] |
|||
public class RolePermissionAppService : AbpProAppService, IRolePermissionAppService |
|||
{ |
|||
private readonly IPermissionAppService _rolePermissionAppService; |
|||
private readonly PermissionOptions _permissionOptions; |
|||
|
|||
public RolePermissionAppService(IPermissionAppService rolePermissionAppService, IOptions<PermissionOptions> permissionOptions) |
|||
{ |
|||
_rolePermissionAppService = rolePermissionAppService; |
|||
_permissionOptions = permissionOptions.Value; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取所有权限
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public async Task<PermissionOutput> GetPermissionAsync(GetPermissionInput input) |
|||
{ |
|||
var permissions = |
|||
await _rolePermissionAppService.GetAsync(input.ProviderName, input.ProviderKey); |
|||
return BuildTreeData(permissions.Groups); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 更新权限
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
[Authorize(IdentityPermissions.Roles.ManagePermissions)] |
|||
public async Task UpdatePermissionAsync(UpdateRolePermissionsInput input) |
|||
{ |
|||
await _rolePermissionAppService.UpdateAsync(input.ProviderName, input.ProviderKey, |
|||
input.UpdatePermissionsDto); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 生成权限树
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
private PermissionOutput BuildTreeData(List<PermissionGroupDto> input) |
|||
{ |
|||
var result = new PermissionOutput(); |
|||
|
|||
|
|||
var permissions = new List<PermissionTreeDto>(); |
|||
|
|||
foreach (var group in input) |
|||
{ |
|||
if (_permissionOptions.IsExclude(group.Name)) continue; |
|||
|
|||
// 获取分组信息
|
|||
var groupPermission = new PermissionTreeDto |
|||
{ |
|||
Key = group.Name, |
|||
Title = group.Name == "AbpIdentity" |
|||
? L[$"Permission:SystemManagement"] |
|||
: group.DisplayName |
|||
}; |
|||
result.Grants.Add(group.Name); |
|||
// 获取所有已授权和未授权权限集合
|
|||
foreach (var item in group.Permissions) |
|||
{ |
|||
if (_permissionOptions.IsExclude(item.Name)) continue; |
|||
|
|||
result.AllGrants.Add(item.Name); |
|||
if (item.IsGranted) |
|||
{ |
|||
result.Grants.Add(item.Name); |
|||
} |
|||
else |
|||
{ |
|||
// 只要没有授权的,就移除顶级的分组
|
|||
result.Grants.Remove(group.Name); |
|||
result.Grants.Remove(item.ParentName); |
|||
} |
|||
} |
|||
|
|||
// 递归菜单
|
|||
var childTreeMenu = RecursionMenu(group.Permissions, null); |
|||
|
|||
groupPermission.Children.AddRange(childTreeMenu.Children); |
|||
|
|||
permissions.Add(groupPermission); |
|||
} |
|||
|
|||
|
|||
result.Permissions = permissions; |
|||
return result; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 递归菜单
|
|||
/// </summary>
|
|||
private PermissionTreeDto RecursionMenu(List<PermissionGrantInfoDto> permissionGrantInfoDtos, |
|||
string parentName) |
|||
{ |
|||
var tree = new PermissionTreeDto(); |
|||
var permissions = permissionGrantInfoDtos |
|||
.Where(e => e.ParentName == parentName && !_permissionOptions.IsExclude(e.Name)).ToList(); |
|||
foreach (var item in permissions) |
|||
{ |
|||
var child = new PermissionTreeDto |
|||
{ |
|||
Key = item.Name, |
|||
Title = item.DisplayName |
|||
}; |
|||
child.Children.AddRange(RecursionMenu(permissionGrantInfoDtos, item.Name).Children); |
|||
tree.Children.Add(child); |
|||
} |
|||
|
|||
return tree; |
|||
} |
|||
} |
|||
} |
|||
@ -1,94 +0,0 @@ |
|||
namespace Lion.AbpPro.Settings |
|||
{ |
|||
[Authorize(policy: AbpProPermissions.SystemManagement.Setting)] |
|||
public class SettingAppService : AbpProAppService, ISettingAppService |
|||
{ |
|||
private readonly ISettingDefinitionManager _settingDefinitionManager; |
|||
private readonly ISettingManager _settingManager; |
|||
private readonly IStringLocalizerFactory _factory; |
|||
|
|||
public SettingAppService( |
|||
ISettingDefinitionManager settingDefinitionManager, |
|||
ISettingManager settingManager, |
|||
IStringLocalizerFactory factory) |
|||
{ |
|||
_settingDefinitionManager = settingDefinitionManager; |
|||
_settingManager = settingManager; |
|||
_factory = factory; |
|||
} |
|||
|
|||
public async Task<List<SettingOutput>> GetAsync() |
|||
{ |
|||
var allSettings = _settingDefinitionManager.GetAll().ToList(); |
|||
var settings = allSettings |
|||
.Where(e => e.Properties.ContainsKey(AbpProSettings.Group.Default)).ToList(); |
|||
|
|||
var settingOutput = settings |
|||
.GroupBy(e => e.Properties[AbpProSettings.Group.Default].ToString()).Select(s => |
|||
new SettingOutput |
|||
{ |
|||
Group = s.Key, |
|||
GroupDisplayName = _factory.CreateDefaultOrNull()[s.Key] |
|||
}).ToList(); |
|||
|
|||
foreach (var item in settingOutput) |
|||
{ |
|||
var currentSettings = settings.Where(e => e.Properties.ContainsValue(item.Group)); |
|||
foreach (var itemDefinition in currentSettings) |
|||
{ |
|||
var value = await SettingProvider.GetOrNullAsync(itemDefinition.Name); |
|||
var type = itemDefinition.Properties |
|||
.FirstOrDefault(f => f.Key == AbpProSettings.ControlType.Default).Value |
|||
.ToString(); |
|||
|
|||
item.SettingItemOutput.Add(new SettingItemOutput( |
|||
itemDefinition.Name, |
|||
itemDefinition.DisplayName.Localize(_factory), |
|||
value, |
|||
type, |
|||
itemDefinition.Description.Localize(_factory))); |
|||
} |
|||
} |
|||
|
|||
return await Task.FromResult(settingOutput); |
|||
} |
|||
|
|||
public async Task UpdateAsync(UpdateSettingInput input) |
|||
{ |
|||
foreach (var kv in input.Values) |
|||
{ |
|||
// The key of the settingValues is in camel_Case, like "setting_Abp_Localization_DefaultLanguage",
|
|||
// change it to "Abp.Localization.DefaultLanguage" form
|
|||
if (!kv.Key.StartsWith(AbpProSettings.Prefix)) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
string name = kv.Key.RemovePreFix(AbpProSettings.Prefix); |
|||
var setting = _settingDefinitionManager.GetOrNull(name); |
|||
if (setting == null) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
await SetSetting(setting, kv.Value); |
|||
} |
|||
} |
|||
|
|||
private Task SetSetting(SettingDefinition setting, string value) |
|||
{ |
|||
if (setting.Providers.Any(p => p == UserSettingValueProvider.ProviderName)) |
|||
{ |
|||
return _settingManager.SetForCurrentUserAsync(setting.Name, value); |
|||
} |
|||
|
|||
if (setting.Providers.Any(p => p == TenantSettingValueProvider.ProviderName)) |
|||
{ |
|||
return _settingManager.SetForCurrentTenantAsync(setting.Name, value); |
|||
} |
|||
|
|||
|
|||
return _settingManager.SetGlobalAsync(setting.Name, value); |
|||
} |
|||
} |
|||
} |
|||
@ -1,73 +0,0 @@ |
|||
namespace Lion.AbpPro.Tenants |
|||
{ |
|||
[Authorize] |
|||
public class VoloTenantAppService : AbpProAppService, IVoloTenantAppService |
|||
{ |
|||
private readonly IAbpTenantAppService _abpTenantAppService; |
|||
private readonly ITenantAppService _tenantAppService; |
|||
|
|||
public VoloTenantAppService( |
|||
IAbpTenantAppService abpTenantAppService, |
|||
ITenantAppService tenantAppService) |
|||
{ |
|||
_abpTenantAppService = abpTenantAppService; |
|||
_tenantAppService = tenantAppService; |
|||
} |
|||
|
|||
public async Task<FindTenantResultDto> FindTenantByNameAsync(FindTenantByNameInput input) |
|||
{ |
|||
return await _abpTenantAppService.FindTenantByNameAsync(input.Name); |
|||
} |
|||
|
|||
|
|||
public Task<PagedResultDto<TenantDto>> ListAsync(PagingTenantInput input) |
|||
{ |
|||
var request = new GetTenantsInput |
|||
{ |
|||
Filter = input.Filter, SkipCount = input.SkipCount, MaxResultCount = input.PageSize |
|||
}; |
|||
return _tenantAppService.GetListAsync(request); |
|||
} |
|||
|
|||
[Authorize(policy:TenantManagementPermissions.Tenants.Create)] |
|||
public Task<TenantDto> CreateAsync(TenantCreateDto input) |
|||
{ |
|||
return _tenantAppService.CreateAsync(input); |
|||
} |
|||
|
|||
[Authorize(policy:TenantManagementPermissions.Tenants.Update)] |
|||
public Task<TenantDto> UpdateAsync(UpdateTenantInput input) |
|||
{ |
|||
var request = new TenantUpdateDto() |
|||
{ |
|||
Name = input.Name.Trim() |
|||
}; |
|||
return _tenantAppService.UpdateAsync(input.Id, request); |
|||
} |
|||
|
|||
[Authorize(policy:TenantManagementPermissions.Tenants.Delete)] |
|||
public Task DeleteAsync(IdInput input) |
|||
{ |
|||
return _tenantAppService.DeleteAsync(input.Id); |
|||
} |
|||
|
|||
[Authorize(TenantManagementPermissions.Tenants.ManageConnectionStrings)] |
|||
public Task<string> GetDefaultConnectionStringAsync(IdInput input) |
|||
{ |
|||
return _tenantAppService.GetDefaultConnectionStringAsync(input.Id); |
|||
} |
|||
|
|||
[Authorize(TenantManagementPermissions.Tenants.ManageConnectionStrings)] |
|||
public Task UpdateDefaultConnectionStringAsync(UpdateConnectionStringInput input) |
|||
{ |
|||
return _tenantAppService.UpdateDefaultConnectionStringAsync(input.Id, |
|||
input.ConnectionString); |
|||
} |
|||
|
|||
[Authorize(TenantManagementPermissions.Tenants.ManageConnectionStrings)] |
|||
public Task DeleteDefaultConnectionStringAsync(IdInput input) |
|||
{ |
|||
return _tenantAppService.DeleteDefaultConnectionStringAsync(input.Id); |
|||
} |
|||
} |
|||
} |
|||
@ -1,112 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IdentityModel.Tokens.Jwt; |
|||
using System.Linq; |
|||
using System.Net.Http; |
|||
using System.Security.Claims; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using IdentityModel; |
|||
using Microsoft.AspNetCore.Http; |
|||
using Microsoft.Extensions.Options; |
|||
using Microsoft.IdentityModel.Tokens; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Identity; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Security.Claims; |
|||
|
|||
|
|||
namespace Lion.AbpPro.Users |
|||
{ |
|||
public class AccountAppService : AbpProAppService, IAccountAppService |
|||
{ |
|||
private readonly IdentityUserManager _userManager; |
|||
private readonly JwtOptions _jwtOptions; |
|||
private readonly Microsoft.AspNetCore.Identity.SignInManager<IdentityUser> _signInManager; |
|||
|
|||
public AccountAppService( |
|||
IdentityUserManager userManager, |
|||
IOptionsSnapshot<JwtOptions> jwtOptions, |
|||
Microsoft.AspNetCore.Identity.SignInManager<IdentityUser> signInManager) |
|||
{ |
|||
_userManager = userManager; |
|||
_jwtOptions = jwtOptions.Value; |
|||
_signInManager = signInManager; |
|||
} |
|||
|
|||
|
|||
public async Task<LoginOutput> LoginAsync(LoginInput input) |
|||
{ |
|||
var result = await _signInManager.PasswordSignInAsync(input.Name, input.Password, false, true); |
|||
if (result.IsNotAllowed) |
|||
{ |
|||
throw new BusinessException(AbpProDomainErrorCodes.UserLockedOut); |
|||
} |
|||
|
|||
if (!result.Succeeded) |
|||
{ |
|||
throw new BusinessException(AbpProDomainErrorCodes.UserOrPasswordMismatch); |
|||
} |
|||
|
|||
var user = await _userManager.FindByNameAsync(input.Name); |
|||
return await BuildResult(user); |
|||
} |
|||
|
|||
#region 私有方法
|
|||
|
|||
|
|||
private async Task<LoginOutput> BuildResult(IdentityUser user) |
|||
{ |
|||
if (!user.IsActive) throw new BusinessException(AbpProDomainErrorCodes.UserLockedOut); |
|||
var roles = await _userManager.GetRolesAsync(user); |
|||
if (roles == null || roles.Count == 0) throw new AbpAuthorizationException(); |
|||
var token = GenerateJwt(user.Id, user.UserName, user.Name, user.Email, |
|||
user.TenantId.ToString(), roles.ToList()); |
|||
var loginOutput = ObjectMapper.Map<IdentityUser, LoginOutput>(user); |
|||
loginOutput.Token = token; |
|||
loginOutput.Roles = roles.ToList(); |
|||
return loginOutput; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 生成jwt token
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
private string GenerateJwt(Guid userId, string userName, string name, string email, |
|||
string tenantId, List<string> roles) |
|||
{ |
|||
var dateNow = DateTime.Now; |
|||
var expirationTime = dateNow + TimeSpan.FromHours(_jwtOptions.ExpirationTime); |
|||
var key = Encoding.ASCII.GetBytes(_jwtOptions.SecurityKey); |
|||
|
|||
var claims = new List<Claim> |
|||
{ |
|||
new Claim(JwtClaimTypes.Audience, _jwtOptions.Audience), |
|||
new Claim(JwtClaimTypes.Issuer, _jwtOptions.Issuer), |
|||
new Claim(AbpClaimTypes.UserId, userId.ToString()), |
|||
new Claim(AbpClaimTypes.Name, name), |
|||
new Claim(AbpClaimTypes.UserName, userName), |
|||
new Claim(AbpClaimTypes.Email, email), |
|||
new Claim(AbpClaimTypes.TenantId, tenantId) |
|||
}; |
|||
|
|||
foreach (var item in roles) |
|||
{ |
|||
claims.Add(new Claim(JwtClaimTypes.Role, item)); |
|||
} |
|||
|
|||
var tokenDescriptor = new SecurityTokenDescriptor() |
|||
{ |
|||
Subject = new ClaimsIdentity(claims), |
|||
Expires = expirationTime, |
|||
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), |
|||
SecurityAlgorithms.HmacSha256Signature) |
|||
}; |
|||
var handler = new JwtSecurityTokenHandler(); |
|||
var token = handler.CreateToken(tokenDescriptor); |
|||
return handler.WriteToken(token); |
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
namespace Lion.AbpPro.Users.Mappers |
|||
{ |
|||
public class UserApplicationAutoMapperProfile:Profile |
|||
{ |
|||
public UserApplicationAutoMapperProfile() |
|||
{ |
|||
CreateMap<Volo.Abp.Identity.IdentityUser, LoginOutput>(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,147 +0,0 @@ |
|||
namespace Lion.AbpPro.Users |
|||
{ |
|||
[Authorize] |
|||
public class UserAppService : AbpProAppService, IUserAppService |
|||
{ |
|||
private readonly IIdentityUserAppService _identityUserAppService; |
|||
private readonly IdentityUserManager _userManager; |
|||
private readonly IIdentityUserRepository _identityUserRepository; |
|||
private readonly IExcelExporter _excelExporter; |
|||
private readonly IOptions<IdentityOptions> _options; |
|||
public UserAppService( |
|||
IIdentityUserAppService identityUserAppService, |
|||
IdentityUserManager userManager, |
|||
IIdentityUserRepository userRepository, |
|||
IExcelExporter excelExporter, |
|||
IOptions<IdentityOptions> options) |
|||
{ |
|||
_identityUserAppService = identityUserAppService; |
|||
_userManager = userManager; |
|||
_identityUserRepository = userRepository; |
|||
_excelExporter = excelExporter; |
|||
_options = options; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 分页查询用户
|
|||
/// </summary>
|
|||
public async Task<PagedResultDto<IdentityUserDto>> ListAsync(PagingUserListInput input) |
|||
{ |
|||
var request = new GetIdentityUsersInput |
|||
{ |
|||
Filter = input.Filter?.Trim(), |
|||
MaxResultCount = input.PageSize, |
|||
SkipCount = input.SkipCount, |
|||
Sorting = " LastModificationTime desc" |
|||
}; |
|||
|
|||
var count = await _identityUserRepository.GetCountAsync(request.Filter); |
|||
var source = await _identityUserRepository |
|||
.GetListAsync(request.Sorting, request.MaxResultCount, request.SkipCount, request.Filter); |
|||
|
|||
return new PagedResultDto<IdentityUserDto>(count, |
|||
base.ObjectMapper.Map<List<Volo.Abp.Identity.IdentityUser>, List<IdentityUserDto>>(source)); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 用户导出列表
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[Authorize(AbpProPermissions.SystemManagement.UserExport)] |
|||
public async Task<ActionResult> ExportAsync(PagingUserListInput input) |
|||
{ |
|||
var request = new GetIdentityUsersInput |
|||
{ |
|||
Filter = input.Filter?.Trim(), |
|||
MaxResultCount = input.PageSize, |
|||
SkipCount = input.SkipCount, |
|||
Sorting = " LastModificationTime desc" |
|||
}; |
|||
var source = await _identityUserRepository |
|||
.GetListAsync(request.Sorting, request.MaxResultCount, request.SkipCount, request.Filter); |
|||
var result = ObjectMapper.Map<List<Volo.Abp.Identity.IdentityUser>, List<ExportIdentityUserOutput>>(source); |
|||
var bytes = await _excelExporter.ExportAsByteArray<ExportIdentityUserOutput>(result); |
|||
return new XlsxFileResult(bytes: bytes, fileDownloadName: $"用户导出列表{DateTime.Now:yyyyMMdd}"); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 新增用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[Authorize(IdentityPermissions.Users.Create)] |
|||
public async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input) |
|||
{ |
|||
// abp 5.0 之后新增字段,是否运行用户登录,默认设置为true
|
|||
input.IsActive = true; |
|||
return await _identityUserAppService.CreateAsync(input); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 更新用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[Authorize(IdentityPermissions.Users.Update)] |
|||
public virtual async Task<IdentityUserDto> UpdateAsync(UpdateUserInput input) |
|||
{ |
|||
input.UserInfo.IsActive = true; |
|||
return await _identityUserAppService.UpdateAsync(input.UserId, input.UserInfo); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除用户
|
|||
/// </summary>
|
|||
[Authorize(IdentityPermissions.Users.Delete)] |
|||
public virtual async Task DeleteAsync(IdInput input) |
|||
{ |
|||
await _identityUserAppService.DeleteAsync(input.Id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取用户角色信息
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public async Task<ListResultDto<IdentityRoleDto>> GetRoleByUserId(IdInput input) |
|||
{ |
|||
return await _identityUserAppService.GetRolesAsync(input.Id); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 修改密码
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
public async Task<bool> ChangePasswordAsync(ChangePasswordInput input) |
|||
{ |
|||
await _options.SetAsync(); |
|||
var identityUser = await _userManager.GetByIdAsync(base.CurrentUser.GetId()); |
|||
IdentityResult result; |
|||
if (identityUser.PasswordHash == null) |
|||
{ |
|||
result = await _userManager.AddPasswordAsync(identityUser, input.NewPassword); |
|||
} |
|||
else |
|||
{ |
|||
result = await _userManager.ChangePasswordAsync(identityUser, input.CurrentPassword, input.NewPassword); |
|||
} |
|||
|
|||
return !result.Succeeded |
|||
? throw new UserFriendlyException(result?.Errors?.FirstOrDefault()?.Description) |
|||
: result.Succeeded; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 锁定用户
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[Authorize(AbpProPermissions.SystemManagement.UserEnable)] |
|||
public async Task LockAsync(LockUserInput input) |
|||
{ |
|||
var identityUser = await _userManager.GetByIdAsync(input.UserId); |
|||
identityUser.SetIsActive(input.Locked); |
|||
await _userManager.UpdateAsync(identityUser); |
|||
} |
|||
} |
|||
} |
|||
@ -1,19 +1,19 @@ |
|||
namespace Lion.AbpPro.Localization.Extensions |
|||
{ |
|||
public static class EnumLocalicationExtension |
|||
{ |
|||
public static string ToLocalicationDescription(this Enum value) |
|||
{ |
|||
var member = |
|||
((IEnumerable<MemberInfo>)value.GetType().GetMember(value.ToString())) |
|||
.FirstOrDefault<MemberInfo>(); |
|||
|
|||
var localKey =$"Enum:{member.ReflectedType.Name}:{value}:{Convert.ToInt16(value)}"; |
|||
if (localKey.IsNullOrWhiteSpace()) |
|||
{ |
|||
throw new ArgumentException(); |
|||
} |
|||
return !(member != (MemberInfo)null) ? value.ToString() : LocalizationHelper.L[localKey]; |
|||
} |
|||
} |
|||
} |
|||
// namespace Lion.AbpPro.Localization.Extensions
|
|||
// {
|
|||
// public static class EnumLocalicationExtension
|
|||
// {
|
|||
// public static string ToLocalicationDescription(this Enum value)
|
|||
// {
|
|||
// var member =
|
|||
// ((IEnumerable<MemberInfo>)value.GetType().GetMember(value.ToString()))
|
|||
// .FirstOrDefault<MemberInfo>();
|
|||
//
|
|||
// var localKey =$"Enum:{member.ReflectedType.Name}:{value}:{Convert.ToInt16(value)}";
|
|||
// if (localKey.IsNullOrWhiteSpace())
|
|||
// {
|
|||
// throw new ArgumentException();
|
|||
// }
|
|||
// return !(member != (MemberInfo)null) ? value.ToString() : LocalizationHelper.L[localKey];
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
@ -1,57 +0,0 @@ |
|||
namespace Lion.AbpPro.Localization |
|||
{ |
|||
public static class LocalizationHelper |
|||
{ |
|||
private static IServiceProvider ServiceProvider { get; set; } |
|||
|
|||
private static IAbpLazyServiceProvider _lazyServiceProvider; |
|||
private static IAbpLazyServiceProvider LazyServiceProvider |
|||
{ |
|||
get |
|||
{ |
|||
return _lazyServiceProvider ??= ServiceProvider.GetRequiredService<IAbpLazyServiceProvider>(); |
|||
} |
|||
} |
|||
|
|||
private static IStringLocalizerFactory StringLocalizerFactory => LazyServiceProvider.LazyGetRequiredService<IStringLocalizerFactory>(); |
|||
|
|||
private static IStringLocalizer _localizer; |
|||
|
|||
private static Type _localizationResource = typeof(AbpProResource); |
|||
|
|||
public static IStringLocalizer L => _localizer ??= CreateLocalizer(); |
|||
|
|||
public static Type LocalizationResource |
|||
{ |
|||
get => _localizationResource; |
|||
set |
|||
{ |
|||
_localizationResource = value; |
|||
_localizer = null; |
|||
} |
|||
} |
|||
|
|||
private static IStringLocalizer CreateLocalizer() |
|||
{ |
|||
if (LocalizationResource != null) |
|||
{ |
|||
return StringLocalizerFactory.Create(LocalizationResource); |
|||
} |
|||
|
|||
return StringLocalizerFactory.CreateDefaultOrNull() ?? |
|||
throw new AbpException(message: "Localizer is null"); |
|||
} |
|||
|
|||
|
|||
public static void InitializeLocalization(this IApplicationBuilder app) |
|||
{ |
|||
ServiceProvider = app.ApplicationServices; |
|||
} |
|||
|
|||
|
|||
public static void InitializeLocalization(this IServiceProvider serviceProvider) |
|||
{ |
|||
ServiceProvider = serviceProvider; |
|||
} |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
namespace Lion.AbpPro.Data.Seeds |
|||
{ |
|||
public class AbpSettingDataSeedContributor : IDataSeedContributor, ITransientDependency |
|||
{ |
|||
private readonly ISettingManager _settingManager; |
|||
private const string DefaultLanguageKey = "Abp.Localization.DefaultLanguage"; |
|||
private const string DefaultLanguage = "zh-Hans"; |
|||
public AbpSettingDataSeedContributor(ISettingManager settingManager) |
|||
{ |
|||
_settingManager = settingManager; |
|||
} |
|||
|
|||
public async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
// 设置默认语言
|
|||
await _settingManager.SetGlobalAsync(DefaultLanguageKey, DefaultLanguage); |
|||
} |
|||
} |
|||
} |
|||
@ -1,34 +0,0 @@ |
|||
namespace Lion.AbpPro.Data.Seeds |
|||
{ |
|||
public class UserDataSeedContributor : IDataSeedContributor, ITransientDependency |
|||
{ |
|||
private readonly IdentityUserManager _userManager; |
|||
private readonly IdentityRoleManager _identityRoleManager; |
|||
|
|||
public UserDataSeedContributor( |
|||
IdentityUserManager userManager, |
|||
IdentityRoleManager identityRoleManager) |
|||
{ |
|||
_userManager = userManager; |
|||
_identityRoleManager = identityRoleManager; |
|||
} |
|||
|
|||
public async Task SeedAsync(DataSeedContext context) |
|||
{ |
|||
// abp 默认会锁定当前用户
|
|||
const string adminUserName = "admin"; |
|||
var adminUser = await _userManager.FindByNameAsync(adminUserName); |
|||
if (adminUser != null) |
|||
{ |
|||
await _userManager.SetLockoutEnabledAsync(adminUser, false); |
|||
} |
|||
|
|||
var role = await _identityRoleManager.FindByNameAsync(adminUserName); |
|||
if (role != null) |
|||
{ |
|||
role.IsDefault = true; |
|||
await _identityRoleManager.UpdateAsync(role); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue