Browse Source

feat(account): 优化个人信息页面

pull/1125/head
colin 11 months ago
parent
commit
4e8ec09044
  1. 6
      Directory.Packages.props
  2. 146
      aspnet-core/LINGYUN.MicroService.All.sln
  3. 28
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs
  4. 3
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/FodyWeavers.xml
  5. 30
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/FodyWeavers.xsd
  6. 26
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/LINGYUN.Abp.Account.Web.IdentityServer.csproj
  7. 136
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/Account/TwoFactorSupportedLoginModel.cs
  8. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml
  9. 12
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Properties/launchSettings.json
  10. 28
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/AbpAccountWebOpenIddictModule.cs
  11. 3
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/FodyWeavers.xml
  12. 30
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/FodyWeavers.xsd
  13. 26
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/LINGYUN.Abp.Account.Web.OpenIddict.csproj
  14. 134
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/TwoFactorSupportedLoginModel.cs
  15. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/_ViewImports.cshtml
  16. 12
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Properties/launchSettings.json
  17. 89
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs
  18. 3
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/FodyWeavers.xml
  19. 30
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/FodyWeavers.xsd
  20. 50
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj
  21. 44
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/AccountProfileAuthenticatorManagementGroupViewComponent.cs
  22. 17
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/Index.cshtml
  23. 5
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/Index.js
  24. 66
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml
  25. 0
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js
  26. 19
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/SecurityLog/AccountProfileSecurityLogManagementGroupViewComponent.cs
  27. 22
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.cshtml
  28. 73
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.js
  29. 19
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Session/AccountProfileSessionManagementGroupViewComponent.cs
  30. 22
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Session/Index.cshtml
  31. 60
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Session/Index.js
  32. 33
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/TwoFactor/AccountProfileTwoFactorManagementGroupViewComponent.cs
  33. 17
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.cshtml
  34. 17
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.js
  35. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml
  36. 148
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml.cs
  37. 26
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml
  38. 46
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml.cs
  39. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml
  40. 256
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs
  41. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml
  42. 148
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml.cs
  43. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/UseRecoveryCode.cshtml
  44. 11
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/UseRecoveryCode.cshtml.cs
  45. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml
  46. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs
  47. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml
  48. 3
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs
  49. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/_ViewImports.cshtml
  50. 53
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/ProfileManagement/SessionManagementPageContributor.cs
  51. 12
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Properties/launchSettings.json
  52. 329
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/client-proxies/account-proxy.js
  53. 29
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprUserMenuContributor.cs
  54. 88
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprWebModule.cs
  55. 3
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/FodyWeavers.xml
  56. 30
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/FodyWeavers.xsd
  57. 39
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/LINGYUN.Abp.Gdpr.Web.csproj
  58. 19
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Components/ProfileManagementGroup/Gdpr/AccountProfileGdprManagementGroupViewComponent.cs
  59. 31
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.cshtml
  60. 108
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.js
  61. 38
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml
  62. 38
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml.cs
  63. 22
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.js
  64. 4
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/_ViewImports.cshtml
  65. 26
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/ProfileManagement/GdprManagementPageContributor.cs
  66. 12
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Properties/launchSettings.json
  67. 71
      aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/wwwroot/client-proxies/gdpr-proxy.js
  68. 4
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsModule.cs
  69. 2
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.md
  70. 12
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs
  71. 42
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs
  72. 326
      aspnet-core/services/LY.MicroService.AuthServer/DataSeeder/AuthServerDataSeedContributor.cs
  73. 22
      aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj
  74. 4
      aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/UseRecoveryCode.cshtml
  75. 16
      aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/UseRecoveryCode.cshtml.cs
  76. 9
      aspnet-core/services/LY.MicroService.AuthServer/Pages/Index.cshtml.cs
  77. 27
      aspnet-core/services/LY.MicroService.AuthServer/appsettings.Development.json
  78. 3
      aspnet-core/services/LY.MicroService.AuthServer/appsettings.json
  79. 23
      aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.Configure.cs
  80. 56
      aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.cs
  81. 25
      aspnet-core/services/LY.MicroService.IdentityServer/LY.MicroService.IdentityServer.csproj
  82. 103
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml
  83. 28
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js
  84. 17
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirm.cshtml
  85. 74
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirm.cshtml.cs
  86. 13
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirmConfirmation.cshtml
  87. 17
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirmConfirmation.cshtml.cs
  88. 26
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendCode.cshtml
  89. 128
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendCode.cshtml.cs
  90. 16
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendEmailConfirm.cshtml
  91. 75
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendEmailConfirm.cshtml.cs
  92. 4
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/UseRecoveryCode.cshtml
  93. 16
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/UseRecoveryCode.cshtml.cs
  94. 26
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyAuthenticatorCode.cshtml
  95. 61
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyAuthenticatorCode.cshtml.cs
  96. 29
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyCode.cshtml
  97. 92
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyCode.cshtml.cs
  98. 9
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/Index.cshtml.cs
  99. 3
      aspnet-core/services/LY.MicroService.IdentityServer/Pages/_ViewImports.cshtml
  100. 31
      aspnet-core/services/LY.MicroService.IdentityServer/appsettings.Development.json

6
Directory.Packages.props

@ -20,6 +20,8 @@
<PackageVersion Include="Volo.Abp.Account.Domain.Shared" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.HttpApi" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.HttpApi.Client" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.Web" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.Web.IdentityServer" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.Web.OpenIddict" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore" Version="$(VoloAbpPackageVersion)" />
@ -135,6 +137,7 @@
<PackageVersion Include="Volo.Abp.TextTemplating.Scriban" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.UI.Navigation" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Users.Abstractions" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Users.Domain.Shared" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Validation" Version="$(VoloAbpPackageVersion)" />
@ -156,6 +159,7 @@
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="$(MicrosoftExtensionsPackageVersion)" />
@ -280,7 +284,7 @@
<PackageVersion Include="Polly" Version="8.4.2" />
<PackageVersion Include="QRCoder" Version="1.5.1" />
<PackageVersion Include="Quartz.Serialization.Json" Version="3.13.0" />
<PackageVersion Include="RulesEngine" Version="4.0.0" />
<PackageVersion Include="RulesEngine" Version="5.0.5" />
<PackageVersion Include="Scriban" Version="5.10.0" />
<PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.5" />

146
aspnet-core/LINGYUN.MicroService.All.sln

@ -400,8 +400,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TextTemplating.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Mvc.Localization", "framework\localization\LINGYUN.Abp.AspNetCore.Mvc.Localization\LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj", "{995DB1CE-A2FC-4468-A521-4207FD587EC5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.Templates", "modules\account\LINGYUN.Abp.Account.Templates\LINGYUN.Abp.Account.Templates.csproj", "{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "caching-management", "caching-management", "{63FCC71F-1CEF-44D3-B95B-23EE58DE8C95}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.CachingManagement.Domain", "modules\caching-management\LINGYUN.Abp.CachingManagement.Domain\LINGYUN.Abp.CachingManagement.Domain.csproj", "{7D6AE2BB-7DBF-4FC8-A1F5-C004D139B278}"
@ -777,6 +775,48 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Platform.HttpApi.Cl
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Emailing.Platform.Tests", "tests\LINGYUN.Abp.Emailing.Platform.Tests\LINGYUN.Abp.Emailing.Platform.Tests.csproj", "{80F44B5B-F8FF-47FA-9A77-BE2D176B2721}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gdpr", "gdpr", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Domain.Shared", "modules\gdpr\LINGYUN.Abp.Gdpr.Domain.Shared\LINGYUN.Abp.Gdpr.Domain.Shared.csproj", "{DD365101-E8FC-6516-2883-B9CA024B36FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Domain", "modules\gdpr\LINGYUN.Abp.Gdpr.Domain\LINGYUN.Abp.Gdpr.Domain.csproj", "{C330BADD-59A0-A3CD-E839-A0D4C2C636EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Domain.Identity", "modules\gdpr\LINGYUN.Abp.Gdpr.Domain.Identity\LINGYUN.Abp.Gdpr.Domain.Identity.csproj", "{F1C6C6B6-5B99-5AA6-7F76-27560C111605}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Application.Contracts", "modules\gdpr\LINGYUN.Abp.Gdpr.Application.Contracts\LINGYUN.Abp.Gdpr.Application.Contracts.csproj", "{459DA653-F12A-65B5-41EF-A5877B1C38BA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Application", "modules\gdpr\LINGYUN.Abp.Gdpr.Application\LINGYUN.Abp.Gdpr.Application.csproj", "{9DD70A99-41A6-8598-553E-2B5AB6277035}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.EntityFrameworkCore", "modules\gdpr\LINGYUN.Abp.Gdpr.EntityFrameworkCore\LINGYUN.Abp.Gdpr.EntityFrameworkCore.csproj", "{016CCD97-3551-B6C7-FC6C-FF1CB7F84B88}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.HttpApi", "modules\gdpr\LINGYUN.Abp.Gdpr.HttpApi\LINGYUN.Abp.Gdpr.HttpApi.csproj", "{F92EBAA6-5BCF-1B7D-FB5E-CDD9F61CA147}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Encryption.SM4", "framework\security\LINGYUN.Abp.Encryption.SM4\LINGYUN.Abp.Encryption.SM4.csproj", "{AE00DA82-B33A-CAF7-D9CD-D5E26608741B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Web", "modules\account\LINGYUN.Abp.Account.Web\LINGYUN.Abp.Account.Web.csproj", "{F9A0D88F-53AE-4AC7-8E15-163C34386E7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Web.IdentityServer", "modules\account\LINGYUN.Abp.Account.Web.IdentityServer\LINGYUN.Abp.Account.Web.IdentityServer.csproj", "{0FF0A04C-B580-4A56-9171-CF2988B5DE5A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Emailing", "modules\account\LINGYUN.Abp.Account.Emailing\LINGYUN.Abp.Account.Emailing.csproj", "{29A87F09-CC03-4DB8-B584-98073AB50AA4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Web.OpenIddict", "modules\account\LINGYUN.Abp.Account.Web.OpenIddict\LINGYUN.Abp.Account.Web.OpenIddict.csproj", "{F810C8A8-1256-440F-BAAF-7F3588291963}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.HttpApi.Client", "modules\account\LINGYUN.Abp.Account.HttpApi.Client\LINGYUN.Abp.Account.HttpApi.Client.csproj", "{FFBE3EC6-F11B-4B7C-9BAF-AFBBB12BEF59}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.HttpApi.Client", "modules\gdpr\LINGYUN.Abp.Gdpr.HttpApi.Client\LINGYUN.Abp.Gdpr.HttpApi.Client.csproj", "{C95DE287-9D21-4DCD-9281-A060B6D99774}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Web", "modules\gdpr\LINGYUN.Abp.Gdpr.Web\LINGYUN.Abp.Gdpr.Web.csproj", "{96748DAE-D367-48C0-B64E-2F25010EAC4D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "exporter", "exporter", "{A4633711-7FB6-411A-8D08-BB9A0A778046}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.Core", "framework\exporter\LINGYUN.Abp.Exporter.Core\LINGYUN.Abp.Exporter.Core.csproj", "{5A0063BF-EE72-E688-84C6-9E3CE0616C94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.MiniExcel", "framework\exporter\LINGYUN.Abp.Exporter.MiniExcel\LINGYUN.Abp.Exporter.MiniExcel.csproj", "{ECE61F58-1AEC-1E4F-1543-76C2242B6F70}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.MagicodesIE.Excel", "framework\exporter\LINGYUN.Abp.Exporter.MagicodesIE.Excel\LINGYUN.Abp.Exporter.MagicodesIE.Excel.csproj", "{B7B63E08-8F62-34F6-FEA5-063267F1FC85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Auditing.HttpApi.Client", "modules\auditing\LINGYUN.Abp.Auditing.HttpApi.Client\LINGYUN.Abp.Auditing.HttpApi.Client.csproj", "{7C48C1CA-7E53-4261-A477-454DD3A8402C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1399,10 +1439,6 @@ Global
{995DB1CE-A2FC-4468-A521-4207FD587EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{995DB1CE-A2FC-4468-A521-4207FD587EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{995DB1CE-A2FC-4468-A521-4207FD587EC5}.Release|Any CPU.Build.0 = Release|Any CPU
{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154}.Release|Any CPU.Build.0 = Release|Any CPU
{7D6AE2BB-7DBF-4FC8-A1F5-C004D139B278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D6AE2BB-7DBF-4FC8-A1F5-C004D139B278}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D6AE2BB-7DBF-4FC8-A1F5-C004D139B278}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -1999,6 +2035,82 @@ Global
{80F44B5B-F8FF-47FA-9A77-BE2D176B2721}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80F44B5B-F8FF-47FA-9A77-BE2D176B2721}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80F44B5B-F8FF-47FA-9A77-BE2D176B2721}.Release|Any CPU.Build.0 = Release|Any CPU
{DD365101-E8FC-6516-2883-B9CA024B36FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD365101-E8FC-6516-2883-B9CA024B36FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD365101-E8FC-6516-2883-B9CA024B36FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD365101-E8FC-6516-2883-B9CA024B36FA}.Release|Any CPU.Build.0 = Release|Any CPU
{C330BADD-59A0-A3CD-E839-A0D4C2C636EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C330BADD-59A0-A3CD-E839-A0D4C2C636EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C330BADD-59A0-A3CD-E839-A0D4C2C636EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C330BADD-59A0-A3CD-E839-A0D4C2C636EE}.Release|Any CPU.Build.0 = Release|Any CPU
{F1C6C6B6-5B99-5AA6-7F76-27560C111605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1C6C6B6-5B99-5AA6-7F76-27560C111605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1C6C6B6-5B99-5AA6-7F76-27560C111605}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1C6C6B6-5B99-5AA6-7F76-27560C111605}.Release|Any CPU.Build.0 = Release|Any CPU
{459DA653-F12A-65B5-41EF-A5877B1C38BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{459DA653-F12A-65B5-41EF-A5877B1C38BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{459DA653-F12A-65B5-41EF-A5877B1C38BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{459DA653-F12A-65B5-41EF-A5877B1C38BA}.Release|Any CPU.Build.0 = Release|Any CPU
{9DD70A99-41A6-8598-553E-2B5AB6277035}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DD70A99-41A6-8598-553E-2B5AB6277035}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DD70A99-41A6-8598-553E-2B5AB6277035}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DD70A99-41A6-8598-553E-2B5AB6277035}.Release|Any CPU.Build.0 = Release|Any CPU
{016CCD97-3551-B6C7-FC6C-FF1CB7F84B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{016CCD97-3551-B6C7-FC6C-FF1CB7F84B88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{016CCD97-3551-B6C7-FC6C-FF1CB7F84B88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{016CCD97-3551-B6C7-FC6C-FF1CB7F84B88}.Release|Any CPU.Build.0 = Release|Any CPU
{F92EBAA6-5BCF-1B7D-FB5E-CDD9F61CA147}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F92EBAA6-5BCF-1B7D-FB5E-CDD9F61CA147}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F92EBAA6-5BCF-1B7D-FB5E-CDD9F61CA147}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F92EBAA6-5BCF-1B7D-FB5E-CDD9F61CA147}.Release|Any CPU.Build.0 = Release|Any CPU
{AE00DA82-B33A-CAF7-D9CD-D5E26608741B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE00DA82-B33A-CAF7-D9CD-D5E26608741B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE00DA82-B33A-CAF7-D9CD-D5E26608741B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE00DA82-B33A-CAF7-D9CD-D5E26608741B}.Release|Any CPU.Build.0 = Release|Any CPU
{F9A0D88F-53AE-4AC7-8E15-163C34386E7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9A0D88F-53AE-4AC7-8E15-163C34386E7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9A0D88F-53AE-4AC7-8E15-163C34386E7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9A0D88F-53AE-4AC7-8E15-163C34386E7C}.Release|Any CPU.Build.0 = Release|Any CPU
{0FF0A04C-B580-4A56-9171-CF2988B5DE5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FF0A04C-B580-4A56-9171-CF2988B5DE5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FF0A04C-B580-4A56-9171-CF2988B5DE5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FF0A04C-B580-4A56-9171-CF2988B5DE5A}.Release|Any CPU.Build.0 = Release|Any CPU
{29A87F09-CC03-4DB8-B584-98073AB50AA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29A87F09-CC03-4DB8-B584-98073AB50AA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29A87F09-CC03-4DB8-B584-98073AB50AA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29A87F09-CC03-4DB8-B584-98073AB50AA4}.Release|Any CPU.Build.0 = Release|Any CPU
{F810C8A8-1256-440F-BAAF-7F3588291963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F810C8A8-1256-440F-BAAF-7F3588291963}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F810C8A8-1256-440F-BAAF-7F3588291963}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F810C8A8-1256-440F-BAAF-7F3588291963}.Release|Any CPU.Build.0 = Release|Any CPU
{FFBE3EC6-F11B-4B7C-9BAF-AFBBB12BEF59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFBE3EC6-F11B-4B7C-9BAF-AFBBB12BEF59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFBE3EC6-F11B-4B7C-9BAF-AFBBB12BEF59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFBE3EC6-F11B-4B7C-9BAF-AFBBB12BEF59}.Release|Any CPU.Build.0 = Release|Any CPU
{C95DE287-9D21-4DCD-9281-A060B6D99774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C95DE287-9D21-4DCD-9281-A060B6D99774}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C95DE287-9D21-4DCD-9281-A060B6D99774}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C95DE287-9D21-4DCD-9281-A060B6D99774}.Release|Any CPU.Build.0 = Release|Any CPU
{96748DAE-D367-48C0-B64E-2F25010EAC4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96748DAE-D367-48C0-B64E-2F25010EAC4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96748DAE-D367-48C0-B64E-2F25010EAC4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96748DAE-D367-48C0-B64E-2F25010EAC4D}.Release|Any CPU.Build.0 = Release|Any CPU
{5A0063BF-EE72-E688-84C6-9E3CE0616C94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A0063BF-EE72-E688-84C6-9E3CE0616C94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A0063BF-EE72-E688-84C6-9E3CE0616C94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A0063BF-EE72-E688-84C6-9E3CE0616C94}.Release|Any CPU.Build.0 = Release|Any CPU
{ECE61F58-1AEC-1E4F-1543-76C2242B6F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECE61F58-1AEC-1E4F-1543-76C2242B6F70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECE61F58-1AEC-1E4F-1543-76C2242B6F70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECE61F58-1AEC-1E4F-1543-76C2242B6F70}.Release|Any CPU.Build.0 = Release|Any CPU
{B7B63E08-8F62-34F6-FEA5-063267F1FC85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7B63E08-8F62-34F6-FEA5-063267F1FC85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7B63E08-8F62-34F6-FEA5-063267F1FC85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7B63E08-8F62-34F6-FEA5-063267F1FC85}.Release|Any CPU.Build.0 = Release|Any CPU
{7C48C1CA-7E53-4261-A477-454DD3A8402C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C48C1CA-7E53-4261-A477-454DD3A8402C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C48C1CA-7E53-4261-A477-454DD3A8402C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C48C1CA-7E53-4261-A477-454DD3A8402C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2192,7 +2304,6 @@ Global
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{995DB1CE-A2FC-4468-A521-4207FD587EC5} = {90E88EAC-4291-4406-8D88-EFDF61B11292}
{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154} = {9E72FEB9-A626-4312-892B-CDD043879758}
{63FCC71F-1CEF-44D3-B95B-23EE58DE8C95} = {D52D5A11-78EF-4154-8298-267738A6715B}
{7D6AE2BB-7DBF-4FC8-A1F5-C004D139B278} = {63FCC71F-1CEF-44D3-B95B-23EE58DE8C95}
{920867B4-4740-4074-9B49-14002B272A63} = {63FCC71F-1CEF-44D3-B95B-23EE58DE8C95}
@ -2375,6 +2486,27 @@ Global
{856B4ACA-BD13-417F-A6E2-0F401F877189} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{B52B199C-0E1C-4CE9-B066-71D26F618424} = {F4923692-D343-4318-AECA-96F580B1A563}
{80F44B5B-F8FF-47FA-9A77-BE2D176B2721} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {D52D5A11-78EF-4154-8298-267738A6715B}
{DD365101-E8FC-6516-2883-B9CA024B36FA} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{C330BADD-59A0-A3CD-E839-A0D4C2C636EE} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{F1C6C6B6-5B99-5AA6-7F76-27560C111605} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{459DA653-F12A-65B5-41EF-A5877B1C38BA} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{9DD70A99-41A6-8598-553E-2B5AB6277035} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{016CCD97-3551-B6C7-FC6C-FF1CB7F84B88} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{F92EBAA6-5BCF-1B7D-FB5E-CDD9F61CA147} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{AE00DA82-B33A-CAF7-D9CD-D5E26608741B} = {9D1302BE-3886-49F8-B0CD-35D2AC1E5A37}
{F9A0D88F-53AE-4AC7-8E15-163C34386E7C} = {9E72FEB9-A626-4312-892B-CDD043879758}
{0FF0A04C-B580-4A56-9171-CF2988B5DE5A} = {9E72FEB9-A626-4312-892B-CDD043879758}
{29A87F09-CC03-4DB8-B584-98073AB50AA4} = {9E72FEB9-A626-4312-892B-CDD043879758}
{F810C8A8-1256-440F-BAAF-7F3588291963} = {9E72FEB9-A626-4312-892B-CDD043879758}
{FFBE3EC6-F11B-4B7C-9BAF-AFBBB12BEF59} = {9E72FEB9-A626-4312-892B-CDD043879758}
{C95DE287-9D21-4DCD-9281-A060B6D99774} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{96748DAE-D367-48C0-B64E-2F25010EAC4D} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{A4633711-7FB6-411A-8D08-BB9A0A778046} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{5A0063BF-EE72-E688-84C6-9E3CE0616C94} = {A4633711-7FB6-411A-8D08-BB9A0A778046}
{ECE61F58-1AEC-1E4F-1543-76C2242B6F70} = {A4633711-7FB6-411A-8D08-BB9A0A778046}
{B7B63E08-8F62-34F6-FEA5-063267F1FC85} = {A4633711-7FB6-411A-8D08-BB9A0A778046}
{7C48C1CA-7E53-4261-A477-454DD3A8402C} = {67DAB2A0-D407-4CAB-8414-AE3D0AC52FC4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

28
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/AbpAccountWebIdentityServerModule.cs

@ -0,0 +1,28 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using VoloAbpAccountWebIdentityServerModule = Volo.Abp.Account.Web.AbpAccountWebIdentityServerModule;
namespace LINGYUN.Abp.Account.Web.IdentityServer;
[DependsOn(
typeof(AbpAccountWebModule),
typeof(VoloAbpAccountWebIdentityServerModule))]
public class AbpAccountWebIdentityServerModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAccountWebIdentityServerModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAccountWebIdentityServerModule>();
});
}
}

3
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

26
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/LINGYUN.Abp.Account.Web.IdentityServer.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Account.Web.IdentityServer</AssemblyName>
<PackageId>LINGYUN.Abp.Account.Web.IdentityServer</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace>LINGYUN.Abp.Account.Web.IdentityServer</RootNamespace>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Account.Web\LINGYUN.Abp.Account.Web.csproj" />
</ItemGroup>
</Project>

136
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/TwoFactorSupportedLoginModel.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/Account/TwoFactorSupportedLoginModel.cs

@ -1,68 +1,68 @@
using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Account.Web;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions;
namespace LY.MicroService.IdentityServer.Pages.Account
{
/// <summary>
/// 重写登录模型,实现双因素登录
/// </summary>
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoginModel), typeof(IdentityServerSupportedLoginModel))]
public class TwoFactorSupportedLoginModel : IdentityServerSupportedLoginModel
{
public TwoFactorSupportedLoginModel(
IAuthenticationSchemeProvider schemeProvider,
IOptions<AbpAccountOptions> accountOptions,
IOptions<IdentityOptions> identityOptions,
IIdentityServerInteractionService interaction,
IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache,
IClientStore clientStore,
IEventService identityServerEvents)
: base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, interaction, clientStore, identityServerEvents)
{
}
protected async override Task<List<ExternalProviderModel>> GetExternalProviders()
{
var providers = await base.GetExternalProviders();
foreach (var provider in providers)
{
var localizedDisplayName = L[provider.DisplayName];
if (localizedDisplayName.ResourceNotFound)
{
localizedDisplayName = L["AuthenticationScheme:" + provider.DisplayName];
}
if (!localizedDisplayName.ResourceNotFound)
{
provider.DisplayName = localizedDisplayName.Value;
}
}
return providers;
}
protected override Task<IActionResult> TwoFactorLoginResultAsync()
{
// 重定向双因素认证页面
return Task.FromResult<IActionResult>(RedirectToPage("SendCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = LoginInput.RememberMe
}));
}
}
}
using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Account.Web;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions;
namespace LINGYUN.Abp.Account.Web.IdentityServer.Pages.Account
{
/// <summary>
/// 重写登录模型,实现双因素登录
/// </summary>
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoginModel), typeof(IdentityServerSupportedLoginModel))]
public class TwoFactorSupportedLoginModel : IdentityServerSupportedLoginModel
{
public TwoFactorSupportedLoginModel(
IAuthenticationSchemeProvider schemeProvider,
IOptions<AbpAccountOptions> accountOptions,
IOptions<IdentityOptions> identityOptions,
IIdentityServerInteractionService interaction,
IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache,
IClientStore clientStore,
IEventService identityServerEvents)
: base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, interaction, clientStore, identityServerEvents)
{
}
protected async override Task<List<ExternalProviderModel>> GetExternalProviders()
{
var providers = await base.GetExternalProviders();
foreach (var provider in providers)
{
var localizedDisplayName = L[provider.DisplayName];
if (localizedDisplayName.ResourceNotFound)
{
localizedDisplayName = L["AuthenticationScheme:" + provider.DisplayName];
}
if (!localizedDisplayName.ResourceNotFound)
{
provider.DisplayName = localizedDisplayName.Value;
}
}
return providers;
}
protected override Task<IActionResult> TwoFactorLoginResultAsync()
{
// 重定向双因素认证页面
return Task.FromResult<IActionResult>(RedirectToPage("SendCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = LoginInput.RememberMe
}));
}
}
}

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

12
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Properties/launchSettings.json

@ -0,0 +1,12 @@
{
"profiles": {
"LINGYUN.Abp.Account.Web.IdentityServer": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:56712;http://localhost:56713"
}
}
}

28
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/AbpAccountWebOpenIddictModule.cs

@ -0,0 +1,28 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using VoloAbpAccountWebOpenIddictModule = Volo.Abp.Account.Web.AbpAccountWebOpenIddictModule;
namespace LINGYUN.Abp.Account.Web.OpenIddict;
[DependsOn(
typeof(AbpAccountWebModule),
typeof(VoloAbpAccountWebOpenIddictModule))]
public class AbpAccountWebOpenIddictModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAccountWebOpenIddictModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAccountWebOpenIddictModule>();
});
}
}

3
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

26
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/LINGYUN.Abp.Account.Web.OpenIddict.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Account.Web.OpenIddict</AssemblyName>
<PackageId>LINGYUN.Abp.Account.Web.OpenIddict</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace>LINGYUN.Abp.Account.Web.OpenIddict</RootNamespace>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Web.OpenIddict" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Account.Web\LINGYUN.Abp.Account.Web.csproj" />
</ItemGroup>
</Project>

134
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/TwoFactorSupportedLoginModel.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/TwoFactorSupportedLoginModel.cs

@ -1,70 +1,64 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using OpenIddict.Server.AspNetCore;
using OpenIddict.Server;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Account.Web;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.OpenIddict;
using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions;
using System.Diagnostics;
using Volo.Abp.Account.Settings;
using Volo.Abp.Settings;
using LINGYUN.Abp.Identity.Session;
namespace LY.MicroService.AuthServer.Pages.Account
{
/// <summary>
/// 重写登录模型,实现双因素登录
/// </summary>
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))]
public class TwoFactorSupportedLoginModel : OpenIddictSupportedLoginModel
{
public TwoFactorSupportedLoginModel(
IAuthenticationSchemeProvider schemeProvider,
IOptions<AbpAccountOptions> accountOptions,
IOptions<IdentityOptions> identityOptions,
IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache,
AbpOpenIddictRequestHelper openIddictRequestHelper)
: base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, openIddictRequestHelper)
{
}
protected async override Task<List<ExternalProviderModel>> GetExternalProviders()
{
var providers = await base.GetExternalProviders();
foreach (var provider in providers)
{
var localizedDisplayName = L[provider.DisplayName];
if (localizedDisplayName.ResourceNotFound)
{
localizedDisplayName = L["AuthenticationScheme:" + provider.DisplayName];
}
if (!localizedDisplayName.ResourceNotFound)
{
provider.DisplayName = localizedDisplayName.Value;
}
}
return providers;
}
protected override Task<IActionResult> TwoFactorLoginResultAsync()
{
// 重定向双因素认证页面
return Task.FromResult<IActionResult>(RedirectToPage("SendCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = LoginInput.RememberMe
}));
}
}
}
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Account.Web;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.OpenIddict;
using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions;
namespace LINGYUN.Abp.Account.Web.OpenIddict.Pages.Account
{
/// <summary>
/// 重写登录模型,实现双因素登录
/// </summary>
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))]
public class TwoFactorSupportedLoginModel : OpenIddictSupportedLoginModel
{
public TwoFactorSupportedLoginModel(
IAuthenticationSchemeProvider schemeProvider,
IOptions<AbpAccountOptions> accountOptions,
IOptions<IdentityOptions> identityOptions,
IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache,
AbpOpenIddictRequestHelper openIddictRequestHelper)
: base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, openIddictRequestHelper)
{
}
protected async override Task<List<ExternalProviderModel>> GetExternalProviders()
{
var providers = await base.GetExternalProviders();
foreach (var provider in providers)
{
var localizedDisplayName = L[provider.DisplayName];
if (localizedDisplayName.ResourceNotFound)
{
localizedDisplayName = L["AuthenticationScheme:" + provider.DisplayName];
}
if (!localizedDisplayName.ResourceNotFound)
{
provider.DisplayName = localizedDisplayName.Value;
}
}
return providers;
}
protected override Task<IActionResult> TwoFactorLoginResultAsync()
{
// 重定向双因素认证页面
return Task.FromResult<IActionResult>(RedirectToPage("SendCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = LoginInput.RememberMe
}));
}
}
}

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

12
aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Properties/launchSettings.json

@ -0,0 +1,12 @@
{
"profiles": {
"LINGYUN.Abp.Account.Web.OpenIddict": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:65279;http://localhost:65280"
}
}
}

89
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs

@ -0,0 +1,89 @@
using LINGYUN.Abp.Account.Emailing;
using LINGYUN.Abp.Account.Web.ProfileManagement;
using LINGYUN.Abp.Identity;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Account.Web.ProfileManagement;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.QRCode;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Sms;
using Volo.Abp.VirtualFileSystem;
using VoloAbpAccountWebModule = Volo.Abp.Account.Web.AbpAccountWebModule;
namespace LINGYUN.Abp.Account.Web;
[DependsOn(
typeof(AbpSmsModule),
typeof(VoloAbpAccountWebModule),
typeof(AbpIdentityDomainModule),
typeof(AbpAccountEmailingModule),
typeof(AbpAccountApplicationContractsModule))]
public class AbpAccountWebModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(AccountResource), typeof(AbpAccountWebModule).Assembly);
});
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAccountWebModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAccountWebModule>();
});
ConfigureProfileManagementPage();
context.Services.AddAutoMapperObjectMapper<AbpAccountWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<AbpAccountWebModule>(validate: true);
});
}
private void ConfigureProfileManagementPage()
{
Configure<ProfileManagementPageOptions>(options =>
{
options.Contributors.Add(new SessionManagementPageContributor());
});
Configure<AbpBundlingOptions>(options =>
{
options.ScriptBundles
.Configure(typeof(ManageModel).FullName,
configuration =>
{
// Client Proxies
configuration.AddFiles("/client-proxies/account-proxy.js");
// Session
configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/Session/Index.js");
// Authenticator
configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/Authenticator/Index.js");
// SecurityLog
configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.js");
// TwoFactor
configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.js");
// QrCode
configuration.AddContributors(typeof(QRCodeScriptContributor));
});
});
}
}

3
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

50
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj

@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Account.Web</AssemblyName>
<PackageId>LINGYUN.Abp.Account.Web</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<RootNamespace>LINGYUN.Abp.Account.Web</RootNamespace>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Modules\**\*.js" />
<EmbeddedResource Include="Modules\**\*.css" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Components\**\*.js" />
<EmbeddedResource Include="Components\**\*.css" />
<EmbeddedResource Include="wwwroot\**\*.js" />
<EmbeddedResource Include="wwwroot\**\*.css" />
<Content Remove="Modules\**\*.js" />
<Content Remove="Modules\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Components\**\*.js" />
<Content Remove="Components\**\*.css" />
<Content Remove="wwwroot\**\*.js" />
<Content Remove="wwwroot\**\*.css" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Sms" />
<PackageReference Include="Volo.Abp.Account.Web" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\identity\LINGYUN.Abp.Identity.Domain\LINGYUN.Abp.Identity.Domain.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Account.Application.Contracts\LINGYUN.Abp.Account.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Account.Emailing\LINGYUN.Abp.Account.Emailing.csproj" />
</ItemGroup>
</Project>

44
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/AccountProfileAuthenticatorManagementGroupViewComponent.cs

@ -0,0 +1,44 @@
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Authenticator;
public class AccountProfileAuthenticatorManagementGroupViewComponent : AbpViewComponent
{
protected IMyProfileAppService ProfileAppService { get; }
public AccountProfileAuthenticatorManagementGroupViewComponent(
IMyProfileAppService profileAppService)
{
ProfileAppService = profileAppService;
}
public async virtual Task<IViewComponentResult> InvokeAsync()
{
var authenticatorDto = await ProfileAppService.GetAuthenticatorAsync();
var model = new AuthenticatorModel
{
AuthenticatorUri = authenticatorDto.AuthenticatorUri,
IsAuthenticated = authenticatorDto.IsAuthenticated,
SharedKey = authenticatorDto.SharedKey,
};
return View("~/Pages/Account/Components/ProfileManagementGroup/Authenticator/Index.cshtml", model);
}
public class AuthenticatorModel
{
public bool IsAuthenticated { get; set; }
public string SharedKey { get; set; }
public string AuthenticatorUri { get; set; }
[Required]
[StringLength(6)]
public string AuthenticatorCode { get; set; }
}
}

17
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/Index.cshtml

@ -0,0 +1,17 @@
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using Volo.Abp.Localization
@inject IHtmlLocalizer<AccountResource> L
@model LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Authenticator.AccountProfileAuthenticatorManagementGroupViewComponent.AuthenticatorModel
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Authenticator"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
</abp-card>

5
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/Index.js

@ -0,0 +1,5 @@
$(function () {
var ul = abp.localization.getResource('AbpUi');
abp.log.warn('Please implement your own authentication procedure!');
});

66
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml

@ -15,7 +15,7 @@
@inject IThemeManager ThemeManager
@inject IStringLocalizerFactory StringLocalizerFactory
@model Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo.AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel
@{
@{
var isUserNameUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled), "true",
StringComparison.OrdinalIgnoreCase);
@ -25,7 +25,7 @@
<h4>@L["PersonalSettings"]</h4><hr/>
<form method="post" id="PersonalSettingsForm">
<input asp-for="ConcurrencyStamp" />
<abp-input asp-for="UserName" readonly="!isUserNameUpdateEnabled"/>
@ -39,41 +39,41 @@
</abp-column>
</abp-row>
<abp-row>
<abp-column size-md="_9">
<abp-input asp-for="Email" readonly="!isEmailUpdateEnabled"/>
</abp-column>
<abp-column size-md="_3">
<div class="mb-3">
<label asp-for="Email" class="form-label"></label>
<div class="input-group">
<input type="email" class="form-control" autocomplete="off" readonly="!isEmailUpdateEnabled" asp-for="Email" />
@if (CurrentUser.EmailVerified)
{
<abp-button button-type="Success" text="@L["Confirmed"].Value"/>
<button class="btn btn-primary" type="button" disabled>@L["Confirmed"].Value</button>
}
else
else
{
@*<abp-button href="/Account/SendEmailConfirm" button-type="Link" text="@L["Validation"].Value" />*@
<a href="/Account/SendEmailConfirm">@L["Validation"].Value</a>
<a abp-button="Primary" asp-page="/Account/SendEmailConfirm">@L["Validation"]</a>
}
</abp-column>
</abp-row>
<span asp-validation-for="Email"></span><br />
</div>
</div>
<abp-input asp-for="PhoneNumber"/>
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel>())
{
var isAllowed = propertyInfo.Configuration.GetOrDefault(IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit);
if (isAllowed == null || !isAllowed.Equals(true))
{
continue;
}
if (!propertyInfo.Name.EndsWith("_Text"))
{
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
{
if (propertyInfo.Type.IsEnum)
{
Model.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type);
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel>())
{
var isAllowed = propertyInfo.Configuration.GetOrDefault(IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit);
if (isAllowed == null || !isAllowed.Equals(true))
{
continue;
}
if (!propertyInfo.Name.EndsWith("_Text"))
{
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
{
if (propertyInfo.Type.IsEnum)
{
Model.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type);
}
<abp-select asp-for="ExtraProperties[propertyInfo.Name]"
name="ExtraProperties.@propertyInfo.Name"
@ -86,8 +86,8 @@
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName">
</abp-select>
}
else
}
else
{
<abp-input type="@propertyInfo.GetInputType()"
asp-for="ExtraProperties[propertyInfo.Name]"
@ -95,8 +95,8 @@
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.GetProperty(propertyInfo.Name))" />
}
}
}
}
}
<abp-button type="submit" button-type="Primary" text="@L["Submit"].Value"/>

0
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js

19
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/SecurityLog/AccountProfileSecurityLogManagementGroupViewComponent.cs

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.SecurityLog;
public class AccountProfileSecurityLogManagementGroupViewComponent : AbpViewComponent
{
public AccountProfileSecurityLogManagementGroupViewComponent()
{
}
public async virtual Task<IViewComponentResult> InvokeAsync()
{
await Task.CompletedTask;
return View("~/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.cshtml");
}
}

22
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.cshtml

@ -0,0 +1,22 @@
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using Volo.Abp.Localization
@inject IHtmlLocalizer<AccountResource> L
@section scripts {
<abp-script src="/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.js" />
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["SecurityLog"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="SecurityLogTable"></abp-table>
</abp-card-body>
</abp-card>

73
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/SecurityLog/Index.js

@ -0,0 +1,73 @@
$(function () {
var ul = abp.localization.getResource('AbpUi');
var l = abp.localization.getResource('AbpAuditLogging');
var dataTable = $('#SecurityLogTable').DataTable(
abp.libs.datatables.normalizeConfiguration({
serverSide: true,
paging: true,
searching: false,
scrollX: true,
ajax: abp.libs.datatables.createAjax(labp.account.mySecurityLog.getList),
columnDefs: [
{
title: ul('Actions'),
rowAction: {
items:
[
{
text: ul('Delete'),
confirmMessage: function () {
return ul('ItemWillBeDeletedMessage');
},
action: function (data) {
labp.account.mySecurityLog
.delete(data.record.id)
.then(function () {
abp.notify.info(
ul('DeletedSuccessfully')
);
dataTable.ajax.reload();
});
}
}
]
}
},
{
title: l('DisplayName:CreationTime'),
data: "creationTime",
render: function (data) {
return luxon
.DateTime
.fromISO(data, {
locale: abp.localization.currentCulture.name
}).toLocaleString(luxon.DateTime.DATETIME_FULL_WITH_SECONDS);
}
},
{
title: l('DisplayName:Identity'),
data: "identity"
},
{
title: l('DisplayName:ClientId'),
data: "clientId"
},
{
title: l('DisplayName:ClientIpAddress'),
data: "clientIpAddress"
},
{
title: l('DisplayName:ApplicationName'),
data: "applicationName"
},
{
title: l('DisplayName:Actions'),
data: "action"
},
{
title: l('DisplayName:BrowserInfo'),
data: "browserInfo"
}]
})
);
});

19
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Session/AccountProfileSessionManagementGroupViewComponent.cs

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Session;
public class AccountProfileSessionManagementGroupViewComponent : AbpViewComponent
{
public AccountProfileSessionManagementGroupViewComponent()
{
}
public async virtual Task<IViewComponentResult> InvokeAsync()
{
await Task.CompletedTask;
return View("~/Pages/Account/Components/ProfileManagementGroup/Session/Index.cshtml");
}
}

22
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Session/Index.cshtml

@ -0,0 +1,22 @@
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using Volo.Abp.Localization
@inject IHtmlLocalizer<AccountResource> L
@section scripts {
<abp-script src="/Pages/Account/Components/ProfileManagementGroup/Session/Index.js" />
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["PersonalSessions"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="SessionsTable"></abp-table>
</abp-card-body>
</abp-card>

60
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Session/Index.js

@ -0,0 +1,60 @@
$(function () {
var ul = abp.localization.getResource('AbpUi');
var il = abp.localization.getResource('AbpIdentity');
var dataTable = $('#SessionsTable').DataTable(
abp.libs.datatables.normalizeConfiguration({
serverSide: true,
paging: true,
searching: false,
scrollX: true,
ajax: abp.libs.datatables.createAjax(labp.account.myProfile.getSessions),
columnDefs: [
{
title: ul('Actions'),
rowAction: {
items:
[
{
text: il('RevokeSession'),
confirmMessage: function () {
return il('SessionWillBeRevokedMessage');
},
visible: function (data) {
return data.sessionId !== abp.currentUser?.sessionId;
},
action: function (data) {
labp.account.myProfile
.revokeSession(data.record.sessionId)
.then(function () {
abp.notify.info(
il('SuccessfullyRevoked')
);
dataTable.ajax.reload();
});
}
}
]
}
},
{
title: il('DisplayName:Device'),
data: "device"
},
{
title: il('DisplayName:IpAddresses'),
data: "ipAddresses"
},
{
title: il('DisplayName:SignedIn'),
data: "signedIn",
render: function (data) {
return luxon
.DateTime
.fromISO(data, {
locale: abp.localization.currentCulture.name
}).toLocaleString(luxon.DateTime.DATETIME_FULL_WITH_SECONDS);
}
}]
})
);
});

33
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/TwoFactor/AccountProfileTwoFactorManagementGroupViewComponent.cs

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.TwoFactor;
public class AccountProfileTwoFactorManagementGroupViewComponent : AbpViewComponent
{
protected IMyProfileAppService ProfileAppService { get; }
public AccountProfileTwoFactorManagementGroupViewComponent(IMyProfileAppService profileAppService)
{
ProfileAppService = profileAppService;
}
public async virtual Task<IViewComponentResult> InvokeAsync()
{
var dto = await ProfileAppService.GetTwoFactorEnabledAsync();
var model = new ChangeTwoFactorModel
{
TwoFactorEnabled = dto.Enabled
};
return View("~/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.cshtml", model);
}
public class ChangeTwoFactorModel
{
[DisplayName("TwoFactor:Enabled")]
public bool TwoFactorEnabled { get; set; }
}
}

17
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.cshtml

@ -0,0 +1,17 @@
@using Volo.Abp.Account.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@inject IHtmlLocalizer<AccountResource> L
@model LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.TwoFactor.AccountProfileTwoFactorManagementGroupViewComponent.ChangeTwoFactorModel
@section scripts {
<abp-script src="/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.js" />
}
<abp-card>
<abp-card-header>
<abp-card-title>@L["TwoFactor"]</abp-card-title>
</abp-card-header>
<abp-card-body>
<abp-input id="TwoFactorEnabled" asp-for="TwoFactorEnabled" />
</abp-card-body>
</abp-card>

17
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/TwoFactor/Default.js

@ -0,0 +1,17 @@
$(function () {
var ul = abp.localization.getResource("AbpUi");
$("#TwoFactorEnabled").change(function () {
var isChecked = $(this).is(':checked');
abp.ui.setBusy({ busy: true });
labp.account.myProfile
.changeTwoFactorEnabled({
enabled: isChecked
})
.then(function () {
abp.notify.success(ul("SavedSuccessfully"));
})
.done(function () {
abp.ui.clearBusy();
});
});
});

2
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/EmailConfirm.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml

@ -2,7 +2,7 @@
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.AuthServer.Pages.Account.EmailConfirmModel
@model LINGYUN.Abp.Account.Web.Pages.Account.EmailConfirmModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">

148
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/EmailConfirm.cshtml.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml.cs

@ -1,74 +1,74 @@
using LINGYUN.Abp.Account;
using Microsoft.AspNetCore.Mvc;
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
using Volo.Abp.Validation;
namespace LY.MicroService.AuthServer.Pages.Account
{
public class EmailConfirmModel : AccountPageModel
{
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid UserId { get; set; }
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ConfirmToken { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public IMyProfileAppService MyProfileAppService { get; set; }
public EmailConfirmModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public async virtual Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
await MyProfileAppService.ConfirmEmailAsync(
new ConfirmEmailInput
{
ConfirmToken = ConfirmToken,
});
}
catch (AbpIdentityResultException e)
{
if (!string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
throw;
}
catch (AbpValidationException)
{
return Page();
}
return RedirectToPage("./ConfirmEmailConfirmation", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash
});
}
}
}
using LINGYUN.Abp.Account;
using Microsoft.AspNetCore.Mvc;
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
using Volo.Abp.Validation;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class EmailConfirmModel : AccountPageModel
{
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid UserId { get; set; }
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ConfirmToken { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public IMyProfileAppService MyProfileAppService { get; set; }
public EmailConfirmModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public async virtual Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
await MyProfileAppService.ConfirmEmailAsync(
new ConfirmEmailInput
{
ConfirmToken = ConfirmToken,
});
}
catch (AbpIdentityResultException e)
{
if (!string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
throw;
}
catch (AbpValidationException)
{
return Page();
}
return RedirectToPage("./ConfirmEmailConfirmation", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash
});
}
}
}

26
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/EmailConfirmConfirmation.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml

@ -1,13 +1,13 @@
@page
@model LY.MicroService.AuthServer.Pages.Account.EmailConfirmConfirmationModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["EmailConfirm"]</h4>
<p>@L["YourEmailIsSuccessfullyConfirm"]</p>
<a abp-button="Primary" href="@Url.Content(Model.ReturnUrl)">@L["GoToTheApplication"]</a>
</div>
</div>
@page
@model LINGYUN.Abp.Account.Web.Pages.Account.EmailConfirmConfirmationModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["EmailConfirm"]</h4>
<p>@L["YourEmailIsSuccessfullyConfirm"]</p>
<a abp-button="Primary" href="@Url.Content(Model.ReturnUrl)">@L["GoToTheApplication"]</a>
</div>
</div>

46
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/EmailConfirmConfirmation.cshtml.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml.cs

@ -1,23 +1,23 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LY.MicroService.AuthServer.Pages.Account;
[AllowAnonymous]
public class EmailConfirmConfirmationModel : AccountPageModel
{
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public async virtual Task<IActionResult> OnGetAsync()
{
ReturnUrl = await GetRedirectUrlAsync(ReturnUrl, ReturnUrlHash);
return Page();
}
}
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LINGYUN.Abp.Account.Web.Pages.Account;
[AllowAnonymous]
public class EmailConfirmConfirmationModel : AccountPageModel
{
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public async virtual Task<IActionResult> OnGetAsync()
{
ReturnUrl = await GetRedirectUrlAsync(ReturnUrl, ReturnUrlHash);
return Page();
}
}

2
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/SendCode.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml

@ -1,7 +1,7 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.AuthServer.Pages.Account.SendCodeModel
@model LINGYUN.Abp.Account.Web.Pages.Account.SendCodeModel
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">

256
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/SendCode.cshtml.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs

@ -1,128 +1,128 @@
using LINGYUN.Abp.Account.Emailing;
using LINGYUN.Abp.Identity.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Sms;
namespace LY.MicroService.AuthServer.Pages.Account
{
public class SendCodeModel : AccountPageModel
{
[BindProperty]
public SendCodeInputModel Input { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public bool RememberMe { get; set; }
public IEnumerable<SelectListItem> Providers { get; set; }
protected ISmsSender SmsSender { get; }
protected IAccountEmailVerifySender AccountEmailVerifySender { get; }
public SendCodeModel(
ISmsSender smsSender,
IAccountEmailVerifySender accountEmailVerifySender)
{
SmsSender = smsSender;
AccountEmailVerifySender = accountEmailVerifySender;
LocalizationResourceType = typeof(AccountResource);
}
public virtual async Task<IActionResult> OnGetAsync()
{
Input = new SendCodeInputModel();
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
// 双因素信息验证失败,一般都是超时了或者用户信息变更
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user);
Providers = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
return Page();
}
public virtual async Task<IActionResult> OnPostAsync()
{
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
if (Input.SelectedProvider == "Authenticator")
{
// 用户通过邮件/短信链接进入授权页面
return RedirectToPage("VerifyAuthenticatorCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
// 生成验证码
var code = await UserManager.GenerateTwoFactorTokenAsync(user, Input.SelectedProvider);
if (string.IsNullOrWhiteSpace(code))
{
Alerts.Warning(L["InvaidGenerateTwoFactorToken"]);
return Page();
}
if (Input.SelectedProvider == "Email")
{
await AccountEmailVerifySender
.SendMailLoginVerifyCodeAsync(
code,
user.UserName,
user.Email);
}
else if (Input.SelectedProvider == "Phone")
{
var phoneNumber = await UserManager.GetPhoneNumberAsync(user);
var templateCode = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin);
Check.NotNullOrWhiteSpace(templateCode, nameof(IdentitySettingNames.User.SmsUserSignin));
// TODO: 以后扩展短信模板发送
var smsMessage = new SmsMessage(phoneNumber, code);
smsMessage.Properties.Add("code", code);
smsMessage.Properties.Add("TemplateCode", templateCode);
await SmsSender.SendAsync(smsMessage);
}
return RedirectToPage("VerifyCode", new
{
provider = Input.SelectedProvider,
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
}
public class SendCodeInputModel
{
public string SelectedProvider { get; set; }
}
}
using LINGYUN.Abp.Account.Emailing;
using LINGYUN.Abp.Identity.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Sms;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class SendCodeModel : AccountPageModel
{
[BindProperty]
public SendCodeInputModel Input { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public bool RememberMe { get; set; }
public IEnumerable<SelectListItem> Providers { get; set; }
protected ISmsSender SmsSender { get; }
protected IAccountEmailVerifySender AccountEmailVerifySender { get; }
public SendCodeModel(
ISmsSender smsSender,
IAccountEmailVerifySender accountEmailVerifySender)
{
SmsSender = smsSender;
AccountEmailVerifySender = accountEmailVerifySender;
LocalizationResourceType = typeof(AccountResource);
}
public virtual async Task<IActionResult> OnGetAsync()
{
Input = new SendCodeInputModel();
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
// 双因素信息验证失败,一般都是超时了或者用户信息变更
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user);
Providers = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
return Page();
}
public virtual async Task<IActionResult> OnPostAsync()
{
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
if (Input.SelectedProvider == "Authenticator")
{
// 用户通过邮件/短信链接进入授权页面
return RedirectToPage("VerifyAuthenticatorCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
// 生成验证码
var code = await UserManager.GenerateTwoFactorTokenAsync(user, Input.SelectedProvider);
if (string.IsNullOrWhiteSpace(code))
{
Alerts.Warning(L["InvaidGenerateTwoFactorToken"]);
return Page();
}
if (Input.SelectedProvider == "Email")
{
await AccountEmailVerifySender
.SendMailLoginVerifyCodeAsync(
code,
user.UserName,
user.Email);
}
else if (Input.SelectedProvider == "Phone")
{
var phoneNumber = await UserManager.GetPhoneNumberAsync(user);
var templateCode = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin);
Check.NotNullOrWhiteSpace(templateCode, nameof(IdentitySettingNames.User.SmsUserSignin));
// TODO: 以后扩展短信模板发送
var smsMessage = new SmsMessage(phoneNumber, code);
smsMessage.Properties.Add("code", code);
smsMessage.Properties.Add("TemplateCode", templateCode);
await SmsSender.SendAsync(smsMessage);
}
return RedirectToPage("VerifyCode", new
{
provider = Input.SelectedProvider,
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
}
public class SendCodeInputModel
{
public string SelectedProvider { get; set; }
}
}

2
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/SendEmailConfirm.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml

@ -2,7 +2,7 @@
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.AuthServer.Pages.Account.SendEmailConfirmModel
@model LINGYUN.Abp.Account.Web.Pages.Account.SendEmailConfirmModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">

148
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/SendEmailConfirm.cshtml.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml.cs

@ -1,75 +1,73 @@
using LINGYUN.Abp.Account;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
using Volo.Abp.Validation;
namespace LY.MicroService.AuthServer.Pages.Account
{
public class SendEmailConfirmModel : AccountPageModel
{
[BindProperty(SupportsGet = true)]
public string Email { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public IMyProfileAppService MyProfileAppService { get; set; }
public SendEmailConfirmModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public virtual Task<IActionResult> OnGetAsync()
{
Email = CurrentUser.Email;
return Task.FromResult<IActionResult>(Page());
}
public async virtual Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
await MyProfileAppService.SendEmailConfirmLinkAsync(
new SendEmailConfirmCodeDto
{
Email = Email,
AppName = "MVC",
ReturnUrl = ReturnUrl,
ReturnUrlHash = ReturnUrlHash
});
}
catch (AbpIdentityResultException e)
{
if (!string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
throw;
}
catch (AbpValidationException)
{
return Page();
}
return RedirectToPage("~/Account/Manage", new
{
returnUrl = ReturnUrl
});
}
}
}
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
using Volo.Abp.Validation;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class SendEmailConfirmModel : AccountPageModel
{
[BindProperty(SupportsGet = true)]
public string Email { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public IMyProfileAppService MyProfileAppService { get; set; }
public SendEmailConfirmModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public virtual Task<IActionResult> OnGetAsync()
{
Email = CurrentUser.Email;
return Task.FromResult<IActionResult>(Page());
}
public async virtual Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
await MyProfileAppService.SendEmailConfirmLinkAsync(
new SendEmailConfirmCodeDto
{
Email = Email,
AppName = "MVC",
ReturnUrl = ReturnUrl,
ReturnUrlHash = ReturnUrlHash
});
}
catch (AbpIdentityResultException e)
{
if (!string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
throw;
}
catch (AbpValidationException)
{
return Page();
}
return RedirectToPage("~/Account/Manage", new
{
returnUrl = ReturnUrl
});
}
}
}

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/UseRecoveryCode.cshtml

@ -0,0 +1,4 @@
@page
@model LINGYUN.Abp.Account.Web.Pages.Account.UseRecoveryCodeModel
@{
}

11
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/UseRecoveryCode.cshtml.cs

@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class UseRecoveryCodeModel : PageModel
{
public void OnGet()
{
}
}
}

2
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyAuthenticatorCode.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml

@ -1,7 +1,7 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.AuthServer.Pages.Account.VerifyAuthenticatorCodeModel
@model LINGYUN.Abp.Account.Web.Pages.Account.VerifyAuthenticatorCodeModel
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">

2
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyAuthenticatorCode.cshtml.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs

@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LY.MicroService.AuthServer.Pages.Account
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class VerifyAuthenticatorCodeModel : AccountPageModel
{

2
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyCode.cshtml → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml

@ -2,7 +2,7 @@
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.AuthServer.Pages.Account.VerifyCodeModel
@model LINGYUN.Abp.Account.Web.Pages.Account.VerifyCodeModel
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<form method="post" class="mt-4">

3
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyCode.cshtml.cs → aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs

@ -1,4 +1,3 @@
using LINGYUN.Abp.Identity.Session;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
@ -7,7 +6,7 @@ using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
namespace LY.MicroService.AuthServer.Pages.Account
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class VerifyCodeModel : AccountPageModel
{

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

53
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/ProfileManagement/SessionManagementPageContributor.cs

@ -0,0 +1,53 @@
using LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Authenticator;
using LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.SecurityLog;
using LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Session;
using LINGYUN.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.TwoFactor;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.ProfileManagement;
namespace LINGYUN.Abp.Account.Web.ProfileManagement;
public class SessionManagementPageContributor : IProfileManagementPageContributor
{
public virtual Task ConfigureAsync(ProfileManagementPageCreationContext context)
{
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AccountResource>>();
context.Groups.Add(
new ProfileManagementPageGroup(
"LINGYUN.Abp.Account.Session",
l["ProfileTab:Session"],
typeof(AccountProfileSessionManagementGroupViewComponent)
)
);
context.Groups.Add(
new ProfileManagementPageGroup(
"LINGYUN.Abp.Account.TwoFactor",
l["ProfileTab:TwoFactor"],
typeof(AccountProfileTwoFactorManagementGroupViewComponent)
)
);
context.Groups.Add(
new ProfileManagementPageGroup(
"LINGYUN.Abp.Account.SecurityLog",
l["ProfileTab:SecurityLog"],
typeof(AccountProfileSecurityLogManagementGroupViewComponent)
)
);
context.Groups.Add(
new ProfileManagementPageGroup(
"LINGYUN.Abp.Account.Authenticator",
l["ProfileTab:Authenticator"],
typeof(AccountProfileAuthenticatorManagementGroupViewComponent)
)
);
return Task.CompletedTask;
}
}

12
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Properties/launchSettings.json

@ -0,0 +1,12 @@
{
"profiles": {
"LINGYUN.Abp.Account.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:51246;http://localhost:51247"
}
}
}

329
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/client-proxies/account-proxy.js

@ -0,0 +1,329 @@
/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */
// module account
(function(){
// controller labp.account.account
(function(){
abp.utils.createNamespace(window, 'labp.account.account');
labp.account.account.register = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/wechat/register',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.account.resetPassword = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/phone/reset-password',
type: 'PUT',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.account.sendPhoneSigninCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/phone/send-signin-code',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.account.sendEmailSigninCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/email/send-signin-code',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.account.sendPhoneRegisterCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/phone/send-register-code',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.account.sendPhoneResetPasswordCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/phone/send-password-reset-code',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.account.getTwoFactorProviders = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/two-factor-providers' + abp.utils.buildQueryString([{ name: 'userId', value: input.userId }]) + '',
type: 'GET'
}, ajaxParams));
};
})();
// controller labp.account.myClaim
(function(){
abp.utils.createNamespace(window, 'labp.account.myClaim');
labp.account.myClaim.changeAvatar = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-claim/change-avatar',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myClaim.getState = function(claimType, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-claim/state/' + claimType + '',
type: 'GET'
}, ajaxParams));
};
labp.account.myClaim.reset = function(claimType, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-claim/reset/' + claimType + '',
type: 'DELETE',
dataType: null
}, ajaxParams));
};
})();
// controller labp.account.myProfile
(function(){
abp.utils.createNamespace(window, 'labp.account.myProfile');
labp.account.myProfile.getSessions = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/sessions' + abp.utils.buildQueryString([{ name: 'device', value: input.device }, { name: 'clientId', value: input.clientId }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '',
type: 'GET'
}, ajaxParams));
};
labp.account.myProfile.revokeSession = function(sessionId, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/sessions/' + sessionId + '/revoke',
type: 'DELETE',
dataType: null
}, ajaxParams));
};
labp.account.myProfile.getTwoFactorEnabled = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/two-factor',
type: 'GET'
}, ajaxParams));
};
labp.account.myProfile.changeTwoFactorEnabled = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/change-two-factor',
type: 'PUT',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myProfile.sendChangePhoneNumberCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/send-phone-number-change-code',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myProfile.changePhoneNumber = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/change-phone-number',
type: 'PUT',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myProfile.sendEmailConfirmLink = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/send-email-confirm-link',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myProfile.confirmEmail = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/confirm-email',
type: 'PUT',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myProfile.getAuthenticator = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/authenticator',
type: 'GET'
}, ajaxParams));
};
labp.account.myProfile.verifyAuthenticatorCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/verify-authenticator-code',
type: 'POST',
data: JSON.stringify(input)
}, ajaxParams));
};
labp.account.myProfile.resetAuthenticator = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/reset-authenticator',
type: 'POST',
dataType: null
}, ajaxParams));
};
})();
// controller labp.account.mySecurityLog
(function(){
abp.utils.createNamespace(window, 'labp.account.mySecurityLog');
labp.account.mySecurityLog['delete'] = function(id, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/security-logs/' + id + '',
type: 'DELETE',
dataType: null
}, ajaxParams));
};
labp.account.mySecurityLog.get = function(id, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/security-logs/' + id + '',
type: 'GET'
}, ajaxParams));
};
labp.account.mySecurityLog.getList = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/security-logs' + abp.utils.buildQueryString([{ name: 'startTime', value: input.startTime }, { name: 'endTime', value: input.endTime }, { name: 'applicationName', value: input.applicationName }, { name: 'identity', value: input.identity }, { name: 'actionName', value: input.actionName }, { name: 'clientId', value: input.clientId }, { name: 'correlationId', value: input.correlationId }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '',
type: 'GET'
}, ajaxParams));
};
})();
// controller volo.abp.account.account
(function(){
abp.utils.createNamespace(window, 'volo.abp.account.account');
volo.abp.account.account.register = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/register',
type: 'POST',
data: JSON.stringify(input)
}, ajaxParams));
};
volo.abp.account.account.sendPasswordResetCode = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/send-password-reset-code',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
volo.abp.account.account.verifyPasswordResetToken = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/verify-password-reset-token',
type: 'POST',
data: JSON.stringify(input)
}, ajaxParams));
};
volo.abp.account.account.resetPassword = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/reset-password',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
})();
// controller volo.abp.account.dynamicClaims
(function(){
abp.utils.createNamespace(window, 'volo.abp.account.dynamicClaims');
volo.abp.account.dynamicClaims.refresh = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/dynamic-claims/refresh',
type: 'POST',
dataType: null
}, ajaxParams));
};
})();
// controller volo.abp.account.profile
(function(){
abp.utils.createNamespace(window, 'volo.abp.account.profile');
volo.abp.account.profile.get = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile',
type: 'GET'
}, ajaxParams));
};
volo.abp.account.profile.update = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile',
type: 'PUT',
data: JSON.stringify(input)
}, ajaxParams));
};
volo.abp.account.profile.changePassword = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/account/my-profile/change-password',
type: 'POST',
dataType: null,
data: JSON.stringify(input)
}, ajaxParams));
};
})();
})();

29
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprUserMenuContributor.cs

@ -0,0 +1,29 @@
using LINGYUN.Abp.Gdpr.Localization;
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
namespace LINGYUN.Abp.Gdpr.Web;
public class AbpGdprUserMenuContributor : IMenuContributor
{
public virtual Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name != StandardMenus.User)
{
return Task.CompletedTask;
}
var gdprResource = context.GetLocalizer<GdprResource>();
context.Menu.AddItem(
new ApplicationMenuItem(
"Account.Delete",
gdprResource["DeletePersonalAccount"],
url: "~/Account/Delete",
icon: "fa fa-remove",
order: int.MaxValue - 999));
return Task.CompletedTask;
}
}

88
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprWebModule.cs

@ -0,0 +1,88 @@
using LINGYUN.Abp.Gdpr.Localization;
using LINGYUN.Abp.Gdpr.Web.Pages.Account;
using LINGYUN.Abp.Gdpr.Web.Pages.Account.Components.ProfileManagementGroup.Gdpr;
using LINGYUN.Abp.Gdpr.Web.ProfileManagement;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Account.Web;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Account.Web.ProfileManagement;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AutoMapper;
using Volo.Abp.Http.ProxyScripting.Generators.JQuery;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Gdpr.Web;
[DependsOn(
typeof(AbpAccountWebModule),
typeof(AbpGdprApplicationContractsModule))]
public class AbpGdprWebModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(GdprResource), typeof(AbpGdprWebModule).Assembly);
});
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpGdprWebModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpGdprWebModule>();
});
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new AbpGdprUserMenuContributor());
});
ConfigureProfileManagementPage();
context.Services.AddAutoMapperObjectMapper<AbpGdprWebModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<AbpGdprWebModule>(validate: true);
});
Configure<DynamicJavaScriptProxyOptions>(options =>
{
options.DisableModule(GdprRemoteServiceConsts.ModuleName);
});
}
private void ConfigureProfileManagementPage()
{
Configure<ProfileManagementPageOptions>(options =>
{
options.Contributors.Add(new GdprManagementPageContributor());
});
Configure<AbpBundlingOptions>(options =>
{
options.ScriptBundles
.Configure(typeof(ManageModel).FullName,
configuration =>
{
configuration.AddFiles("/client-proxies/gdpr-proxy.js");
configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.js");
});
options.ScriptBundles
.Configure(typeof(DeleteModel).FullName,
configuration =>
{
configuration.AddFiles("/client-proxies/gdpr-proxy.js");
configuration.AddFiles("/Pages/Account/Delete.js");
});
});
}
}

3
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

39
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/LINGYUN.Abp.Gdpr.Web.csproj

@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Gdpr.Web</AssemblyName>
<PackageId>LINGYUN.Abp.Gdpr.Web</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<RootNamespace>LINGYUN.Abp.Gdpr.Web</RootNamespace>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Modules\**\*.js" />
<EmbeddedResource Include="Modules\**\*.css" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="wwwroot\**\*.js" />
<EmbeddedResource Include="wwwroot\**\*.css" />
<Content Remove="Modules\**\*.js" />
<Content Remove="Modules\**\*.css" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Account.Web" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Gdpr.Application.Contracts\LINGYUN.Abp.Gdpr.Application.Contracts.csproj" />
</ItemGroup>
</Project>

19
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Components/ProfileManagementGroup/Gdpr/AccountProfileGdprManagementGroupViewComponent.cs

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.Gdpr.Web.Pages.Account.Components.ProfileManagementGroup.Gdpr;
public class AccountProfileGdprManagementGroupViewComponent : AbpViewComponent
{
public AccountProfileGdprManagementGroupViewComponent()
{
}
public async virtual Task<IViewComponentResult> InvokeAsync()
{
await Task.CompletedTask;
return View("~/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.cshtml");
}
}

31
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.cshtml

@ -0,0 +1,31 @@
@using LINGYUN.Abp.Gdpr.Web.Pages.Account.Components.ProfileManagementGroup.Gdpr
@using Microsoft.AspNetCore.Mvc.Localization
@using LINGYUN.Abp.Gdpr.Localization
@using Volo.Abp.Localization
@inject IHtmlLocalizer<GdprResource> L
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["PersonalData"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-right">
<abp-button-group>
<abp-button id="RequestPersonalDataButton"
text="@L["RequestPersonalData"].Value"
icon="id-card"
button-type="Primary" />
<abp-button id="DeletePersonalDataButton"
text="@L["DeletePersonalData"].Value"
icon="remove"
button-type="Outline_Danger" />
</abp-button-group>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="PersonalDataTable"></abp-table>
</abp-card-body>
</abp-card>

108
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.js

@ -0,0 +1,108 @@
$(function () {
var ul = abp.localization.getResource('AbpUi');
var gl = abp.localization.getResource('AbpGdpr');
var dataTable = $('#PersonalDataTable').DataTable(
abp.libs.datatables.normalizeConfiguration({
serverSide: true,
paging: true,
searching: false,
scrollX: true,
ajax: abp.libs.datatables.createAjax(labp.gdpr.gdprRequest.getList),
columnDefs: [
{
title: ul('Actions'),
rowAction: {
items:
[
{
text: gl('Download'),
visible: function (data) {
const now = luxon.DateTime.now();
const readyTime = luxon.DateTime.fromISO(data.readyTime, {
locale: abp.localization.currentCulture.name
});
return now >= readyTime;
},
action: function (data) {
var downloadWindow = window.open(
abp.appPath + 'api/gdpr/requests/personal-data/download/' + data.record.id + '',
"_blank"
);
downloadWindow.focus();
}
},
{
text: ul('Delete'),
confirmMessage: function () {
return ul('ItemWillBeDeletedMessage');
},
action: function (data) {
labp.gdpr.gdprRequest
.delete(data.record.id)
.then(function () {
abp.notify.info(
ul('DeletedSuccessfully')
);
dataTable.ajax.reload();
});
}
}
]
}
},
{
title: gl('DisplayName:ReadyTime'),
data: "readyTime",
render: function (data) {
return luxon
.DateTime
.fromISO(data, {
locale: abp.localization.currentCulture.name
}).toLocaleString(luxon.DateTime.DATETIME_FULL_WITH_SECONDS);
}
},
{
title: gl('DisplayName:CreationTime'),
data: "creationTime",
render: function (data) {
return luxon
.DateTime
.fromISO(data, {
locale: abp.localization.currentCulture.name
}).toLocaleString(luxon.DateTime.DATETIME_FULL_WITH_SECONDS);
}
}]
})
);
$('#RequestPersonalDataButton').click(function (e) {
e.preventDefault();
labp.gdpr.gdprRequest
.preparePersonalData()
.then(function () {
abp.notify.success(
gl('PersonalDataPrepareRequestReceived')
);
dataTable.ajax.reload();
});
});
$('#DeletePersonalDataButton').click(function (e) {
e.preventDefault();
abp.message.confirm(
gl('DeletePersonalDataWarning'),
function (confirm) {
if (confirm) {
labp.gdpr.gdprRequest
.deletePersonalData()
.then(function () {
abp.notify.success(
gl('PersonalDataDeleteRequestReceived')
);
dataTable.ajax.reload();
});
}
}
);
});
});

38
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml

@ -0,0 +1,38 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@using LINGYUN.Abp.Gdpr.Localization
@using LINGYUN.Abp.Gdpr.Web.Pages.Account
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
@inject IThemeManager ThemeManager
@inject IHtmlLocalizer<GdprResource> L
@inject IHtmlLocalizer<AccountResource> AL
@model DeleteModel
@{
Layout = ThemeManager.CurrentTheme.GetApplicationLayout();
}
@section scripts {
<abp-script-bundle name="@typeof(DeleteModel).FullName" />
}
@if (!Model.ReturnUrl.IsNullOrWhiteSpace())
{
<abp-row class="mb-2">
<abp-column>
<a class="btn btn-primary" href="@Model.ReturnUrl">
<i class="fa fa-chevron-left me-2"></i>@AL["ReturnToApplication"]
</a>
</abp-column>
</abp-row>
}
<div id="ProfileManagementWrapper">
<abp-card>
<abp-card-header>
<abp-button id="DeletePersonalAccountButton"
text="@L["DeletePersonalAccount"].Value"
icon="remove"
button-type="Outline_Danger" />
</abp-card-header>
</abp-card>
</div>

38
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml.cs

@ -0,0 +1,38 @@
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LINGYUN.Abp.Gdpr.Web.Pages.Account;
public class DeleteModel : AccountPageModel
{
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
public DeleteModel()
{
}
public virtual async Task<IActionResult> OnGetAsync()
{
if (ReturnUrl != null)
{
if (!Url.IsLocalUrl(ReturnUrl) &&
!ReturnUrl.StartsWith(UriHelper.BuildAbsolute(Request.Scheme, Request.Host, Request.PathBase).RemovePostFix("/")) &&
!await AppUrlProvider.IsRedirectAllowedUrlAsync(ReturnUrl))
{
ReturnUrl = null;
}
}
return Page();
}
public virtual Task<IActionResult> OnPostAsync()
{
return Task.FromResult<IActionResult>(Page());
}
}

22
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.js

@ -0,0 +1,22 @@
$(function () {
var l = abp.localization.getResource('AbpGdpr');
$('#DeletePersonalAccountButton').click(function (e) {
e.preventDefault();
abp.message.confirm(
l('DeletePersonalAccountWarning'),
function (confirm) {
if (confirm) {
labp.gdpr.gdprRequest
.deletePersonalAccount()
.then(function () {
abp.notify.success(
l('PersonalAccountDeleteRequestReceived')
);
$(location).attr('href', '/Account/Login');
});
}
}
);
});
});

4
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/_ViewImports.cshtml

@ -0,0 +1,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

26
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/ProfileManagement/GdprManagementPageContributor.cs

@ -0,0 +1,26 @@
using LINGYUN.Abp.Gdpr.Localization;
using LINGYUN.Abp.Gdpr.Web.Pages.Account.Components.ProfileManagementGroup.Gdpr;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.ProfileManagement;
namespace LINGYUN.Abp.Gdpr.Web.ProfileManagement;
public class GdprManagementPageContributor : IProfileManagementPageContributor
{
public virtual Task ConfigureAsync(ProfileManagementPageCreationContext context)
{
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<GdprResource>>();
context.Groups.Add(
new ProfileManagementPageGroup(
"LINGYUN.Abp.Account.Gdpr",
l["PersonalData"],
typeof(AccountProfileGdprManagementGroupViewComponent)
)
);
return Task.CompletedTask;
}
}

12
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Properties/launchSettings.json

@ -0,0 +1,12 @@
{
"profiles": {
"LINGYUN.Abp.Gdpr.Web": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:64471;http://localhost:64472"
}
}
}

71
aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/wwwroot/client-proxies/gdpr-proxy.js

@ -0,0 +1,71 @@
/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */
// module gdpr
(function(){
// controller labp.gdpr.gdprRequest
(function(){
abp.utils.createNamespace(window, 'labp.gdpr.gdprRequest');
labp.gdpr.gdprRequest['delete'] = function(id, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests/' + id + '',
type: 'DELETE',
dataType: null
}, ajaxParams));
};
labp.gdpr.gdprRequest.deletePersonalAccount = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests/personal-account',
type: 'DELETE',
dataType: null
}, ajaxParams));
};
labp.gdpr.gdprRequest.deletePersonalData = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests/personal-data',
type: 'DELETE',
dataType: null
}, ajaxParams));
};
labp.gdpr.gdprRequest.get = function(id, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests/' + id + '',
type: 'GET'
}, ajaxParams));
};
labp.gdpr.gdprRequest.getList = function(input, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests' + abp.utils.buildQueryString([{ name: 'creationTime', value: input.creationTime }, { name: 'readyTime', value: input.readyTime }, { name: 'sorting', value: input.sorting }, { name: 'skipCount', value: input.skipCount }, { name: 'maxResultCount', value: input.maxResultCount }]) + '',
type: 'GET'
}, ajaxParams));
};
labp.gdpr.gdprRequest.downloadPersonalData = function(requestId, ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests/personal-data/download/' + requestId + '',
type: 'GET'
}, ajaxParams));
};
labp.gdpr.gdprRequest.preparePersonalData = function(ajaxParams) {
return abp.ajax($.extend(true, {
url: abp.appPath + 'api/gdpr/requests/personal-data/prepare',
type: 'POST',
dataType: null
}, ajaxParams));
};
})();
})();

4
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsValidatorModule.cs → aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsModule.cs

@ -9,7 +9,7 @@ using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.IdentityServer;
[DependsOn(typeof(AbpIdentityServerDomainModule))]
public class AbpIdentityServerSmsValidatorModule : AbpModule
public class AbpIdentityServerSmsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
@ -23,7 +23,7 @@ public class AbpIdentityServerSmsValidatorModule : AbpModule
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpIdentityServerSmsValidatorModule>();
options.FileSets.AddEmbedded<AbpIdentityServerSmsModule>();
});
Configure<AbpLocalizationOptions>(options =>

2
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/README.md

@ -24,7 +24,7 @@ IdentityServer短信验证模块,提供基于手机号和短信验证码的身
```csharp
[DependsOn(
typeof(AbpIdentityServerSmsValidatorModule)
typeof(AbpIdentityServerSmsModule)
)]
public class YourModule : AbpModule
{

12
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs

@ -1,4 +1,6 @@
using DotNetCore.CAP;
using LINGYUN.Abp.Account.Web;
using LINGYUN.Abp.Account.Web.OpenIddict;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.OpenIddict.AspNetCore.Session;
using LINGYUN.Abp.OpenIddict.LinkUser;
@ -23,6 +25,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.IdentityModel.Logging;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
@ -48,6 +51,7 @@ using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.OpenIddict;
using Volo.Abp.Security.Claims;
using Volo.Abp.SettingManagement;
using Volo.Abp.Threading;
using Volo.Abp.Timing;
using Volo.Abp.UI.Navigation.Urls;
@ -225,6 +229,14 @@ public partial class AuthServerModule
});
}
private void ConfigureSettingManagement()
{
Configure<SettingManagementOptions>(options =>
{
options.IsDynamicSettingStoreEnabled = true;
});
}
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式

42
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs

@ -1,47 +1,41 @@
using LINGYUN.Abp.Account;
using LINGYUN.Abp.Account.Web.OpenIddict;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authentication.QQ;
using LINGYUN.Abp.Authentication.WeChat;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.Emailing.Platform;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.Exporter.MiniExcel;
using LINGYUN.Abp.Gdpr;
using LINGYUN.Abp.Gdpr.Web;
using LINGYUN.Abp.Identity.AspNetCore.Session;
using LINGYUN.Abp.Identity.EntityFrameworkCore;
using LINGYUN.Abp.Identity.OrganizaztionUnits;
using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.OpenIddict.AspNetCore.Session;
using LINGYUN.Abp.OpenIddict.LinkUser;
using LINGYUN.Abp.OpenIddict.Portal;
using LINGYUN.Abp.OpenIddict.Sms;
using LINGYUN.Abp.OpenIddict.WeChat;
using LINGYUN.Abp.OpenIddict.WeChat.Work;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Platform.EntityFrameworkCore;
using LINGYUN.Abp.Sms.Platform;
using LY.MicroService.AuthServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.MailKit;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace LY.MicroService.AuthServer;
@ -49,16 +43,18 @@ namespace LY.MicroService.AuthServer;
typeof(AbpSerilogEnrichersApplicationModule),
typeof(AbpSerilogEnrichersUniqueIdModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpGdprApplicationModule),
typeof(AbpGdprHttpApiModule),
typeof(AbpGdprWebModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAutofacModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityAspNetCoreSessionModule),
typeof(AbpOpenIddictAspNetCoreSessionModule),
typeof(AbpOpenIddictEntityFrameworkCoreModule),
typeof(AbpIdentitySessionAspNetCoreModule),
typeof(AbpOpenIddictSmsModule),
typeof(AbpOpenIddictWeChatModule),
typeof(AbpOpenIddictLinkUserModule),
@ -67,22 +63,17 @@ namespace LY.MicroService.AuthServer;
typeof(AbpAuthenticationQQModule),
typeof(AbpAuthenticationWeChatModule),
typeof(AbpIdentityOrganizaztionUnitsModule),
typeof(PlatformEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpSaasEntityFrameworkCoreModule),
typeof(AuthServerMigrationsEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAuditLoggingElasticsearchModule), // 放在 AbpIdentity 模块之后,避免被覆盖
typeof(AbpLocalizationCultureMapModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpMailKitModule),
typeof(AbpCAPEventBusModule),
typeof(AbpAliyunSmsModule)
typeof(AbpExporterMiniExcelModule),
typeof(AbpEmailingPlatformModule),
typeof(AbpSmsPlatformModule),
typeof(AbpCAPEventBusModule)
)]
public partial class AuthServerModule : AbpModule
{
@ -110,6 +101,7 @@ public partial class AuthServerModule : AbpModule
ConfigureIdentity(configuration);
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
ConfigureSettingManagement();
ConfigureLocalization();
ConfigureDataSeeder();
ConfigureUrls(configuration);

326
aspnet-core/services/LY.MicroService.AuthServer/DataSeeder/AuthServerDataSeedContributor.cs

@ -2,42 +2,52 @@
using LINGYUN.Abp.OpenIddict.LinkUser;
using LINGYUN.Abp.OpenIddict.Sms;
using LINGYUN.Abp.OpenIddict.WeChat;
using OpenIddict.Abstractions;
using OpenIddict.Abstractions;
using System;
using System.Globalization;
using System.Globalization;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
namespace LY.MicroService.AuthServer.DataSeeder;
public class ServerDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
private readonly IGuidGenerator _guidGenerator;
private readonly IOpenIddictApplicationManager _applicationManager;
private readonly IOpenIddictScopeManager _scopeManager;
private readonly IIdentityClaimTypeRepository _claimTypeRepository;
public ServerDataSeedContributor(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IOpenIddictScopeManager scopeManager,
IOpenIddictApplicationManager applicationManager,
IIdentityClaimTypeRepository identityClaimTypeRepository)
{
_currentTenant = currentTenant;
_guidGenerator = guidGenerator;
_scopeManager = scopeManager;
_applicationManager = applicationManager;
_claimTypeRepository = identityClaimTypeRepository;
}
public async Task SeedAsync(DataSeedContext context)
{
using Volo.Abp.MultiTenancy;
using Volo.Abp.OpenIddict.Applications;
using Volo.Abp.OpenIddict.Scopes;
namespace LY.MicroService.AuthServer.DataSeeder;
public class ServerDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
private readonly IGuidGenerator _guidGenerator;
private readonly IOpenIddictApplicationManager _applicationManager;
private readonly IOpenIddictApplicationRepository _applicationRepository;
private readonly IOpenIddictScopeManager _scopeManager;
private readonly IOpenIddictScopeRepository _scopeRepository;
private readonly IIdentityClaimTypeRepository _claimTypeRepository;
public ServerDataSeedContributor(
ICurrentTenant currentTenant,
IGuidGenerator guidGenerator,
IOpenIddictScopeManager scopeManager,
IOpenIddictScopeRepository scopeRepository,
IOpenIddictApplicationManager applicationManager,
IOpenIddictApplicationRepository applicationRepository,
IIdentityClaimTypeRepository identityClaimTypeRepository)
{
_currentTenant = currentTenant;
_guidGenerator = guidGenerator;
_scopeManager = scopeManager;
_scopeRepository = scopeRepository;
_applicationManager = applicationManager;
_applicationRepository = applicationRepository;
_claimTypeRepository = identityClaimTypeRepository;
}
public async Task SeedAsync(DataSeedContext context)
{
if (!await _claimTypeRepository.AnyAsync(IdentityConsts.ClaimType.Avatar.Name))
{
await _claimTypeRepository.InsertAsync(
@ -47,129 +57,129 @@ public class ServerDataSeedContributor : IDataSeedContributor, ITransientDepende
isStatic: true
)
);
}
if (await _scopeManager.FindByNameAsync("lingyun-abp-application") == null)
{
await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor()
{
Name = "lingyun-abp-application",
DisplayName = "lingyun-abp-application",
DisplayNames =
{
[CultureInfo.GetCultureInfo("en")] = "abp application",
[CultureInfo.GetCultureInfo("zh-Hans")] = "abp application",
},
Resources =
{
"lingyun-abp-application"
}
});
}
if (await _applicationManager.FindByClientIdAsync("vue-admin-client") == null)
{
await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor
{
ClientId = "vue-admin-client",
ClientSecret = "1q2w3e*",
ConsentType = OpenIddictConstants.ConsentTypes.Explicit,
DisplayName = "Vue Vben Admin Abp Application",
PostLogoutRedirectUris =
{
new Uri("https://127.0.0.1:3100/signout-callback-oidc"),
new Uri("http://127.0.0.1:3100")
},
RedirectUris =
{
new Uri("https://127.0.0.1:3100/signin-oidc"),
new Uri("http://127.0.0.1:3100")
},
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.Device,
OpenIddictConstants.Permissions.Endpoints.Introspection,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.Endpoints.Logout,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.Implicit,
OpenIddictConstants.Permissions.GrantTypes.Password,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.GrantTypes.DeviceCode,
OpenIddictConstants.Permissions.GrantTypes.ClientCredentials,
OpenIddictConstants.Permissions.Prefixes.GrantType + WeChatTokenExtensionGrantConsts.OfficialGrantType,
OpenIddictConstants.Permissions.Prefixes.GrantType + WeChatTokenExtensionGrantConsts.MiniProgramGrantType,
OpenIddictConstants.Permissions.Prefixes.GrantType + SmsTokenExtensionGrantConsts.GrantType,
OpenIddictConstants.Permissions.Prefixes.GrantType + LinkUserTokenExtensionGrantConsts.GrantType,
OpenIddictConstants.Permissions.ResponseTypes.Code,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeToken,
OpenIddictConstants.Permissions.ResponseTypes.IdToken,
OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.None,
OpenIddictConstants.Permissions.ResponseTypes.Token,
OpenIddictConstants.Permissions.Scopes.Roles,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Address,
OpenIddictConstants.Permissions.Scopes.Phone,
OpenIddictConstants.Permissions.Prefixes.Scope + WeChatTokenExtensionGrantConsts.ProfileKey,
OpenIddictConstants.Permissions.Prefixes.Scope + "lingyun-abp-application"
}
});
}
if (await _applicationManager.FindByClientIdAsync("InternalServiceClient") == null)
{
await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor
{
ClientId = "InternalServiceClient",
ClientSecret = "1q2w3e*",
ClientType = OpenIddictConstants.ClientTypes.Confidential,
ConsentType = OpenIddictConstants.ConsentTypes.Explicit,
DisplayName = "Internal Service Client",
PostLogoutRedirectUris = {},
RedirectUris = {},
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.Device,
OpenIddictConstants.Permissions.Endpoints.Introspection,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.Endpoints.Logout,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.Implicit,
OpenIddictConstants.Permissions.GrantTypes.Password,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.GrantTypes.DeviceCode,
OpenIddictConstants.Permissions.GrantTypes.ClientCredentials,
OpenIddictConstants.Permissions.ResponseTypes.Code,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeToken,
OpenIddictConstants.Permissions.ResponseTypes.IdToken,
OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.None,
OpenIddictConstants.Permissions.ResponseTypes.Token,
OpenIddictConstants.Permissions.Scopes.Roles,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Address,
OpenIddictConstants.Permissions.Scopes.Phone,
OpenIddictConstants.Permissions.Prefixes.Scope + "lingyun-abp-application"
}
});
}
}
}
}
if (await _scopeRepository.FindByNameAsync("lingyun-abp-application") == null)
{
await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor()
{
Name = "lingyun-abp-application",
DisplayName = "lingyun-abp-application",
DisplayNames =
{
[CultureInfo.GetCultureInfo("en")] = "abp application",
[CultureInfo.GetCultureInfo("zh-Hans")] = "abp application",
},
Resources =
{
"lingyun-abp-application"
}
});
}
if (await _applicationRepository.FindByClientIdAsync("vue-admin-client") == null)
{
await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor
{
ClientId = "vue-admin-client",
ClientSecret = "1q2w3e*",
ConsentType = OpenIddictConstants.ConsentTypes.Explicit,
DisplayName = "Vue Vben Admin Abp Application",
PostLogoutRedirectUris =
{
new Uri("https://127.0.0.1:3100/signout-callback-oidc"),
new Uri("http://127.0.0.1:3100")
},
RedirectUris =
{
new Uri("https://127.0.0.1:3100/signin-oidc"),
new Uri("http://127.0.0.1:3100")
},
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.Device,
OpenIddictConstants.Permissions.Endpoints.Introspection,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.Endpoints.Logout,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.Implicit,
OpenIddictConstants.Permissions.GrantTypes.Password,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.GrantTypes.DeviceCode,
OpenIddictConstants.Permissions.GrantTypes.ClientCredentials,
OpenIddictConstants.Permissions.Prefixes.GrantType + WeChatTokenExtensionGrantConsts.OfficialGrantType,
OpenIddictConstants.Permissions.Prefixes.GrantType + WeChatTokenExtensionGrantConsts.MiniProgramGrantType,
OpenIddictConstants.Permissions.Prefixes.GrantType + SmsTokenExtensionGrantConsts.GrantType,
OpenIddictConstants.Permissions.Prefixes.GrantType + LinkUserTokenExtensionGrantConsts.GrantType,
OpenIddictConstants.Permissions.ResponseTypes.Code,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeToken,
OpenIddictConstants.Permissions.ResponseTypes.IdToken,
OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.None,
OpenIddictConstants.Permissions.ResponseTypes.Token,
OpenIddictConstants.Permissions.Scopes.Roles,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Address,
OpenIddictConstants.Permissions.Scopes.Phone,
OpenIddictConstants.Permissions.Prefixes.Scope + WeChatTokenExtensionGrantConsts.ProfileKey,
OpenIddictConstants.Permissions.Prefixes.Scope + "lingyun-abp-application"
}
});
}
if (await _applicationRepository.FindByClientIdAsync("InternalServiceClient") == null)
{
await _applicationManager.CreateAsync(new OpenIddictApplicationDescriptor
{
ClientId = "InternalServiceClient",
ClientSecret = "1q2w3e*",
ClientType = OpenIddictConstants.ClientTypes.Confidential,
ConsentType = OpenIddictConstants.ConsentTypes.Explicit,
DisplayName = "Internal Service Client",
PostLogoutRedirectUris = {},
RedirectUris = {},
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.Device,
OpenIddictConstants.Permissions.Endpoints.Introspection,
OpenIddictConstants.Permissions.Endpoints.Revocation,
OpenIddictConstants.Permissions.Endpoints.Logout,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.Implicit,
OpenIddictConstants.Permissions.GrantTypes.Password,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.GrantTypes.DeviceCode,
OpenIddictConstants.Permissions.GrantTypes.ClientCredentials,
OpenIddictConstants.Permissions.ResponseTypes.Code,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.CodeToken,
OpenIddictConstants.Permissions.ResponseTypes.IdToken,
OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken,
OpenIddictConstants.Permissions.ResponseTypes.None,
OpenIddictConstants.Permissions.ResponseTypes.Token,
OpenIddictConstants.Permissions.Scopes.Roles,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Address,
OpenIddictConstants.Permissions.Scopes.Phone,
OpenIddictConstants.Permissions.Prefixes.Scope + "lingyun-abp-application"
}
});
}
}
}

22
aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\common.secrets.props" />
@ -44,20 +44,13 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>-->
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Account.Application" />
<PackageReference Include="Volo.Abp.Account.Web.OpenIddict" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" />
<PackageReference Include="Volo.Abp.Identity.AspNetCore" />
<PackageReference Include="Volo.Abp.MailKit" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" />
<PackageReference Include="Volo.Abp.OpenIddict.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
</ItemGroup>
<ItemGroup>
@ -67,7 +60,7 @@
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />
<ProjectReference Include="..\..\framework\exporter\LINGYUN.Abp.Exporter.MiniExcel\LINGYUN.Abp.Exporter.MiniExcel.csproj" />
<ProjectReference Include="..\..\framework\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
@ -77,20 +70,23 @@
<ItemGroup>
<ProjectReference Include="..\..\migrations\LY.MicroService.AuthServer.EntityFrameworkCore\LY.MicroService.AuthServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.Application\LINGYUN.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.HttpApi\LINGYUN.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.Web.OpenIddict\LINGYUN.Abp.Account.Web.OpenIddict.csproj" />
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.Application\LINGYUN.Abp.Gdpr.Application.csproj" />
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.HttpApi\LINGYUN.Abp.Gdpr.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.Web\LINGYUN.Abp.Gdpr.Web.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Application.Contracts\LINGYUN.Abp.Identity.Application.Contracts.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.AspNetCore.Session\LINGYUN.Abp.Identity.AspNetCore.Session.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.OrganizaztionUnits\LINGYUN.Abp.Identity.OrganizaztionUnits.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj" />
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.AspNetCore.Session\LINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.LinkUser\LINGYUN.Abp.OpenIddict.LinkUser.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.Portal\LINGYUN.Abp.OpenIddict.Portal.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.Sms\LINGYUN.Abp.OpenIddict.Sms.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.WeChat.Work\LINGYUN.Abp.OpenIddict.WeChat.Work.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.WeChat\LINGYUN.Abp.OpenIddict.WeChat.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.EntityFrameworkCore\LINGYUN.Platform.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
</ItemGroup>
</Project>

4
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/UseRecoveryCode.cshtml

@ -1,4 +0,0 @@
@page
@model LY.MicroService.AuthServer.Pages.Account.UseRecoveryCodeModel
@{
}

16
aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/UseRecoveryCode.cshtml.cs

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LY.MicroService.AuthServer.Pages.Account
{
public class UseRecoveryCodeModel : PageModel
{
public void OnGet()
{
}
}
}

9
aspnet-core/services/LY.MicroService.AuthServer/Pages/Index.cshtml.cs

@ -1,11 +1,10 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace LY.MicroService.AuthServer.Pages
namespace LY.MicroService.AuthServer.Pages;
public class IndexModel : AbpPageModel
{
public class IndexModel : AbpPageModel
public void OnGet()
{
public void OnGet()
{
}
}
}

27
aspnet-core/services/LY.MicroService.AuthServer/appsettings.Development.json

@ -6,7 +6,8 @@
"secret": "1q2w3E*",
"nodes": "http://127.0.0.1:15000",
"name": "AuthServer",
"tag": "AuthServer"
"tag": "AuthServer",
"configCacheEncrypt": true
},
"App": {
"CorsOrigins": "http://127.0.0.1:3100",
@ -44,16 +45,10 @@
}
},
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=AuthServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpIdentity": "Server=127.0.0.1;Database=AuthServer-v70;User Id=root;Password=123456;SslMode=None",
"OpenIddict": "Server=127.0.0.1;Database=AuthServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"AppPlatform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None"
"Default": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"Platform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"Identity": "Server=127.0.0.1;Database=AuthServer-V70;User Id=root;Password=123456;SslMode=None",
"Realtime": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None"
},
"CAP": {
"EventBus": {
@ -86,6 +81,12 @@
"Configuration": "127.0.0.1,defaultDatabase=10",
"InstanceName": "LINGYUN.Abp.Application"
},
"RemoteServices": {
"Platform": {
"BaseUrl": "http://127.0.0.1:30025",
"UseCurrentAccessToken": false
}
},
"AuthServer": {
"Authority": "http://127.0.0.1:44385/",
"Audience": "lingyun-abp-application",
@ -134,11 +135,11 @@
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Default": "Information",
"Override": {
"System": "Warning",
"Microsoft": "Warning",
"DotNetCore": "Debug"
"DotNetCore": "Information"
}
},
"WriteTo": [

3
aspnet-core/services/LY.MicroService.AuthServer/appsettings.json

@ -11,7 +11,6 @@
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
@ -19,7 +18,7 @@
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Default": "Information",
"Override": {
"System": "Warning",
"Microsoft": "Warning",

23
aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.Configure.cs

@ -1,4 +1,6 @@
using DotNetCore.CAP;
using LINGYUN.Abp.Account.Web;
using LINGYUN.Abp.Account.Web.IdentityServer;
using LINGYUN.Abp.Identity.Session;
using LINGYUN.Abp.IdentityServer.IdentityResources;
using LINGYUN.Abp.Localization.CultureMap;
@ -20,6 +22,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.IdentityModel.Logging;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
@ -47,6 +50,7 @@ using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Security.Claims;
using Volo.Abp.SettingManagement;
using Volo.Abp.Threading;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem;
@ -165,6 +169,14 @@ public partial class IdentityServerModule
});
}
private void ConfigureSettingManagement()
{
Configure<SettingManagementOptions>(options =>
{
options.IsDynamicSettingStoreEnabled = true;
});
}
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
@ -272,12 +284,21 @@ public partial class IdentityServerModule
options.IsRemoteRefreshEnabled = false;
});
}
private void ConfigureVirtualFileSystem()
private void ConfigureVirtualFileSystem(IWebHostEnvironment hostingEnvironment)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<IdentityServerModule>("LY.MicroService.IdentityServer");
});
if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebModule>(hostingEnvironment.ContentRootPath);
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebIdentityServerModule>(hostingEnvironment.ContentRootPath);
});
}
}
private void ConfigureMvcUiTheme()

56
aspnet-core/services/LY.MicroService.IdentityServer/IdentityServerModule.cs

@ -1,48 +1,41 @@
using LINGYUN.Abp.Account;
using LINGYUN.Abp.Account.Web.IdentityServer;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authentication.QQ;
using LINGYUN.Abp.Authentication.WeChat;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.Emailing.Platform;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.Http.Client.Wrapper;
using LINGYUN.Abp.Exporter.MiniExcel;
using LINGYUN.Abp.Gdpr;
using LINGYUN.Abp.Gdpr.Web;
using LINGYUN.Abp.Identity.AspNetCore.Session;
using LINGYUN.Abp.Identity.EntityFrameworkCore;
using LINGYUN.Abp.Identity.OrganizaztionUnits;
using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.IdentityServer;
using LINGYUN.Abp.IdentityServer.EntityFrameworkCore;
using LINGYUN.Abp.IdentityServer.LinkUser;
using LINGYUN.Abp.IdentityServer.Portal;
using LINGYUN.Abp.IdentityServer.Session;
using LINGYUN.Abp.IdentityServer.WeChat.Work;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Platform.EntityFrameworkCore;
using LINGYUN.Abp.Sms.Platform;
using LY.MicroService.IdentityServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.MailKit;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace LY.MicroService.IdentityServer;
@ -50,47 +43,36 @@ namespace LY.MicroService.IdentityServer;
typeof(AbpSerilogEnrichersApplicationModule),
typeof(AbpSerilogEnrichersUniqueIdModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpGdprApplicationModule),
typeof(AbpGdprHttpApiModule),
typeof(AbpGdprWebModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpAutofacModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityApplicationModule),
// 请勿混淆这两个模块, 他们各自都自己的职能
// 此模块仅用于认证中心
typeof(AbpIdentityAspNetCoreSessionModule),
// 此模块可用于所有微服务
typeof(AbpIdentityServerSessionModule),
typeof(AbpIdentitySessionAspNetCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpIdentityServerSmsValidatorModule),
typeof(AbpIdentityServerSmsModule),
typeof(AbpIdentityServerLinkUserModule),
typeof(AbpIdentityServerPortalModule),
typeof(AbpIdentityServerWeChatWorkModule),
typeof(AbpIdentityServerSessionModule),
typeof(AbpAuthenticationWeChatModule),
typeof(AbpAuthenticationQQModule),
typeof(AbpAuthenticationWeChatModule),
typeof(AbpIdentityOrganizaztionUnitsModule),
typeof(PlatformEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpSaasEntityFrameworkCoreModule),
typeof(IdentityServerMigrationsEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
//typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAuditLoggingElasticsearchModule), // 放在 AbpIdentity 模块之后,避免被覆盖
typeof(AbpLocalizationCultureMapModule),
typeof(AbpCAPEventBusModule),
typeof(AbpMailKitModule),
typeof(AbpHttpClientWrapperModule),
typeof(AbpAspNetCoreMvcWrapperModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpAliyunSmsModule)
typeof(AbpExporterMiniExcelModule),
typeof(AbpEmailingPlatformModule),
typeof(AbpSmsPlatformModule),
typeof(AbpCAPEventBusModule)
)]
public partial class IdentityServerModule : AbpModule
{
@ -115,8 +97,8 @@ public partial class IdentityServerModule : AbpModule
ConfigureCaching(configuration);
ConfigureIdentity(configuration);
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
ConfigureSettingManagement();
ConfigureLocalization();
ConfigureAuditing(configuration);
ConfigureDataSeeder();

25
aspnet-core/services/LY.MicroService.IdentityServer/LY.MicroService.IdentityServer.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\common.secrets.props" />
@ -41,20 +41,13 @@
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Account.Application" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" />
<PackageReference Include="Volo.Abp.MailKit" />
<PackageReference Include="Volo.Abp.Identity.AspNetCore" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
</ItemGroup>
<ItemGroup>
@ -65,29 +58,31 @@
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Http.Client.Wrapper\LINGYUN.Abp.Http.Client.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />
<ProjectReference Include="..\..\framework\exporter\LINGYUN.Abp.Exporter.MiniExcel\LINGYUN.Abp.Exporter.MiniExcel.csproj" />
<ProjectReference Include="..\..\framework\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\migrations\LY.MicroService.IdentityServer.EntityFrameworkCore\LY.MicroService.IdentityServer.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\migrations\LY.MicroService.IdentityServer.EntityFrameworkCore\LY.MicroService.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.Application\LINGYUN.Abp.Account.Application.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.EntityFrameworkCore\LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.HttpApi\LINGYUN.Abp.Account.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\account\LINGYUN.Abp.Account.Web.IdentityServer\LINGYUN.Abp.Account.Web.IdentityServer.csproj" />
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.Application\LINGYUN.Abp.Gdpr.Application.csproj" />
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.HttpApi\LINGYUN.Abp.Gdpr.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\gdpr\LINGYUN.Abp.Gdpr.Web\LINGYUN.Abp.Gdpr.Web.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.LinkUser\LINGYUN.Abp.IdentityServer.LinkUser.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Portal\LINGYUN.Abp.IdentityServer.Portal.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Session\LINGYUN.Abp.IdentityServer.Session.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.WeChat.Work\LINGYUN.Abp.IdentityServer.WeChat.Work.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.AspNetCore.Session\LINGYUN.Abp.Identity.AspNetCore.Session.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.OrganizaztionUnits\LINGYUN.Abp.Identity.OrganizaztionUnits.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj" />
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.EntityFrameworkCore\LINGYUN.Platform.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
</ItemGroup>
</Project>

103
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.cshtml

@ -1,103 +0,0 @@
@using Volo.Abp.Account.Localization
@using Volo.Abp.Users
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Localization
@using Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
@using Volo.Abp.Data
@using Volo.Abp.Identity.Settings
@using Volo.Abp.Localization
@using Volo.Abp.Settings
@using Volo.Abp.ObjectExtending
@inject IHtmlLocalizer<AccountResource> L
@inject ICurrentUser CurrentUser
@inject ISettingProvider SettingManager
@inject IThemeManager ThemeManager
@inject IStringLocalizerFactory StringLocalizerFactory
@model Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.PersonalInfo.AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel
@{
var isUserNameUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled), "true",
StringComparison.OrdinalIgnoreCase);
var isEmailUpdateEnabled = string.Equals(await SettingManager.GetOrNullAsync(IdentitySettingNames.User.IsEmailUpdateEnabled), "true",
StringComparison.OrdinalIgnoreCase);
}
<h4>@L["PersonalSettings"]</h4><hr/>
<form method="post" id="PersonalSettingsForm">
<input asp-for="ConcurrencyStamp" />
<abp-input asp-for="UserName" readonly="!isUserNameUpdateEnabled"/>
<abp-row>
<abp-column size-md="_6">
<abp-input asp-for="Name"/>
</abp-column>
<abp-column size-md="_6">
<abp-input asp-for="Surname"/>
</abp-column>
</abp-row>
<abp-row>
<abp-column size-md="_9">
<abp-input asp-for="Email" readonly="!isEmailUpdateEnabled"/>
</abp-column>
<abp-column size-md="_3">
@if (CurrentUser.EmailVerified)
{
<abp-button button-type="Success" text="@L["Confirmed"].Value"/>
}
else
{
<a href="/Account/SendEmailConfirm">@L["Validation"].Value</a>
}
</abp-column>
</abp-row>
<abp-input asp-for="PhoneNumber"/>
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<AccountProfilePersonalInfoManagementGroupViewComponent.PersonalInfoModel>())
{
var isAllowed = propertyInfo.Configuration.GetOrDefault(IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit);
if (isAllowed == null || !isAllowed.Equals(true))
{
continue;
}
if (!propertyInfo.Name.EndsWith("_Text"))
{
if (propertyInfo.Type.IsEnum || !propertyInfo.Lookup.Url.IsNullOrEmpty())
{
if (propertyInfo.Type.IsEnum)
{
Model.ExtraProperties.ToEnum(propertyInfo.Name, propertyInfo.Type);
}
<abp-select asp-for="ExtraProperties[propertyInfo.Name]"
name="ExtraProperties.@propertyInfo.Name"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
autocomplete-api-url="@propertyInfo.Lookup.Url"
autocomplete-selected-item-name="@Model.GetProperty(propertyInfo.Name + "_Text")"
autocomplete-selected-item-value="@Model.GetProperty(propertyInfo.Name)"
autocomplete-filter-param-name="@propertyInfo.Lookup.FilterParamName"
autocomplete-items-property-name="@propertyInfo.Lookup.ResultListPropertyName"
autocomplete-display-property-name="@propertyInfo.Lookup.DisplayPropertyName"
autocomplete-value-property-name="@propertyInfo.Lookup.ValuePropertyName">
</abp-select>
}
else
{
<abp-input type="@propertyInfo.GetInputType()"
asp-for="ExtraProperties[propertyInfo.Name]"
name="ExtraProperties.@propertyInfo.Name"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.GetProperty(propertyInfo.Name))" />
}
}
}
<abp-button type="submit" button-type="Primary" text="@L["Submit"].Value"/>
</form>

28
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/Components/ProfileManagementGroup/PersonalInfo/Default.js

@ -1,28 +0,0 @@
(function ($) {
$(function () {
var l = abp.localization.getResource("AbpAccount");
$('#PersonalSettingsForm').submit(function (e) {
e.preventDefault();
if (!$('#PersonalSettingsForm').valid()) {
return false;
}
var input = $('#PersonalSettingsForm').serializeFormToObject();
volo.abp.account.profile.update(input).then(function (result) {
abp.notify.success(l('PersonalSettingsSaved'));
updateConcurrencyStamp();
});
});
});
abp.event.on('passwordChanged', updateConcurrencyStamp);
function updateConcurrencyStamp(){
volo.abp.account.profile.get().then(function(profile){
$("#ConcurrencyStamp").val(profile.concurrencyStamp);
});
}
})(jQuery);

17
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirm.cshtml

@ -1,17 +0,0 @@
@page
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.IdentityServer.Pages.Account.EmailConfirmModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["EmailConfirm"]</h4>
<form method="post">
<abp-input asp-for="UserId" />
<abp-input asp-for="ConfirmToken" />
<a abp-button="Secondary" asp-page="./">@L["Cancel"]</a>
<abp-button type="submit" button-type="Primary">@L["Submit"]</abp-button>
</form>
</div>
</div>

74
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirm.cshtml.cs

@ -1,74 +0,0 @@
using LINGYUN.Abp.Account;
using Microsoft.AspNetCore.Mvc;
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
using Volo.Abp.Validation;
namespace LY.MicroService.IdentityServer.Pages.Account
{
public class EmailConfirmModel : AccountPageModel
{
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid UserId { get; set; }
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ConfirmToken { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public IMyProfileAppService MyProfileAppService { get; set; }
public EmailConfirmModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public async virtual Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
await MyProfileAppService.ConfirmEmailAsync(
new ConfirmEmailInput
{
ConfirmToken = ConfirmToken,
});
}
catch (AbpIdentityResultException e)
{
if (!string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
throw;
}
catch (AbpValidationException)
{
return Page();
}
return RedirectToPage("EmailConfirmConfirmation", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash
});
}
}
}

13
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirmConfirmation.cshtml

@ -1,13 +0,0 @@
@page
@model LY.MicroService.IdentityServer.Pages.Account.EmailConfirmConfirmationModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["EmailConfirm"]</h4>
<p>@L["YourEmailIsSuccessfullyConfirm"]</p>
<a abp-button="Primary" href="@Url.Content(Model.ReturnUrl)">@L["GoToTheApplication"]</a>
</div>
</div>

17
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/EmailConfirmConfirmation.cshtml.cs

@ -1,17 +0,0 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LY.MicroService.IdentityServer.Pages.Account;
[AllowAnonymous]
public class EmailConfirmConfirmationModel : AccountPageModel
{
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
}

26
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendCode.cshtml

@ -1,26 +0,0 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.IdentityServer.Pages.Account.SendCodeModel
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["TwoFactor"]</h4>
<form method="post" class="mt-4">
<abp-input asp-for="RememberMe" />
<input asp-for="ReturnUrl" />
<input asp-for="ReturnUrlHash" />
<div class="form-group">
<abp-select asp-for="Input.SelectedProvider" label="@L["SelectedProvider"].Value" asp-items="@Model.Providers"></abp-select>
</div>
<div class="d-grid gap-2">
<abp-button type="submit" button-type="Primary" class="mt-2 mb-3">@L["SendVerifyCode"]</abp-button>
</div>
<a asp-page="./Login" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})">
<i class="fa fa-long-arrow-left"></i> @L["Login"]
</a>
</form>
</div>
</div>

128
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendCode.cshtml.cs

@ -1,128 +0,0 @@
using LINGYUN.Abp.Account.Emailing;
using LINGYUN.Abp.Identity.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Sms;
namespace LY.MicroService.IdentityServer.Pages.Account
{
public class SendCodeModel : AccountPageModel
{
[BindProperty]
public SendCodeInputModel Input { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public bool RememberMe { get; set; }
public IEnumerable<SelectListItem> Providers { get; set; }
protected ISmsSender SmsSender { get; }
protected IAccountEmailVerifySender AccountEmailVerifySender { get; }
public SendCodeModel(
ISmsSender smsSender,
IAccountEmailVerifySender accountEmailVerifySender)
{
SmsSender = smsSender;
AccountEmailVerifySender = accountEmailVerifySender;
LocalizationResourceType = typeof(AccountResource);
}
public async virtual Task<IActionResult> OnGetAsync()
{
Input = new SendCodeInputModel();
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
// 双因素信息验证失败,一般都是超时了或者用户信息变更
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user);
Providers = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
return Page();
}
public async virtual Task<IActionResult> OnPostAsync()
{
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
if (Input.SelectedProvider == "Authenticator")
{
// 用户通过邮件/短信链接进入授权页面
return RedirectToPage("VerifyAuthenticatorCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
// 生成验证码
var code = await UserManager.GenerateTwoFactorTokenAsync(user, Input.SelectedProvider);
if (string.IsNullOrWhiteSpace(code))
{
Alerts.Warning(L["InvaidGenerateTwoFactorToken"]);
return Page();
}
if (Input.SelectedProvider == "Email")
{
await AccountEmailVerifySender
.SendMailLoginVerifyCodeAsync(
code,
user.UserName,
user.Email);
}
else if (Input.SelectedProvider == "Phone")
{
var phoneNumber = await UserManager.GetPhoneNumberAsync(user);
var templateCode = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin);
Check.NotNullOrWhiteSpace(templateCode, nameof(IdentitySettingNames.User.SmsUserSignin));
// TODO: 以后扩展短信模板发送
var smsMessage = new SmsMessage(phoneNumber, code);
smsMessage.Properties.Add("code", code);
smsMessage.Properties.Add("TemplateCode", templateCode);
await SmsSender.SendAsync(smsMessage);
}
return RedirectToPage("VerifyCode", new
{
provider = Input.SelectedProvider,
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
}
public class SendCodeInputModel
{
public string SelectedProvider { get; set; }
}
}

16
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendEmailConfirm.cshtml

@ -1,16 +0,0 @@
@page
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.IdentityServer.Pages.Account.SendEmailConfirmModel
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["EmailConfirm"]</h4>
<form method="post">
<abp-input asp-for="Email" readonly="true" />
<a abp-button="Secondary" asp-page="./Login">@L["Cancel"]</a>
<abp-button type="submit" button-type="Primary" text="@L["ClickToValidation"].Value"/>
</form>
</div>
</div>

75
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/SendEmailConfirm.cshtml.cs

@ -1,75 +0,0 @@
using LINGYUN.Abp.Account;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Identity;
using Volo.Abp.Validation;
namespace LY.MicroService.IdentityServer.Pages.Account
{
public class SendEmailConfirmModel : AccountPageModel
{
[BindProperty(SupportsGet = true)]
public string Email { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
public IMyProfileAppService MyProfileAppService { get; set; }
public SendEmailConfirmModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public virtual Task<IActionResult> OnGetAsync()
{
Email = CurrentUser.Email;
return Task.FromResult<IActionResult>(Page());
}
public async virtual Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
await MyProfileAppService.SendEmailConfirmLinkAsync(
new SendEmailConfirmCodeDto
{
Email = Email,
AppName = "MVC",
ReturnUrl = ReturnUrl,
ReturnUrlHash = ReturnUrlHash
});
}
catch (AbpIdentityResultException e)
{
if (!string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
throw;
}
catch (AbpValidationException)
{
return Page();
}
return RedirectToPage("~/Account/Manage", new
{
returnUrl = ReturnUrl
});
}
}
}

4
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/UseRecoveryCode.cshtml

@ -1,4 +0,0 @@
@page
@model LY.MicroService.IdentityServer.Pages.Account.UseRecoveryCodeModel
@{
}

16
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/UseRecoveryCode.cshtml.cs

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LY.MicroService.IdentityServer.Pages.Account
{
public class UseRecoveryCodeModel : PageModel
{
public void OnGet()
{
}
}
}

26
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyAuthenticatorCode.cshtml

@ -1,26 +0,0 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.IdentityServer.Pages.Account.VerifyAuthenticatorCodeModel
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<form method="post" class="mt-4">
<input asp-for="RememberMe" />
<input asp-for="ReturnUrlHash" />
<div class="form-group">
<label asp-for="Input.VerifyCode"></label>
<input asp-for="Input.VerifyCode" class="form-control" />
<span asp-validation-for="Input.VerifyCode" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="RememberBrowser"></label>
<abp-input asp-for="RememberBrowser" />
</div>
<abp-button type="submit" button-type="Primary" class="btn-block btn-lg mt-3">@L["VerifyAuthenticatorCode"]</abp-button>
<a asp-page="./Login" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})">
<i class="fa fa-long-arrow-left"></i> @L["Login"]
</a>
</form>
</div>
</div>

61
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyAuthenticatorCode.cshtml.cs

@ -1,61 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LY.MicroService.IdentityServer.Pages.Account
{
public class VerifyAuthenticatorCodeModel : AccountPageModel
{
[BindProperty]
public VerifyAuthenticatorCodeInputModel Input { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
[BindProperty(SupportsGet = true)]
public bool RememberBrowser { get; set; }
[HiddenInput]
public bool RememberMe { get; set; }
public virtual IActionResult OnGet()
{
Input = new VerifyAuthenticatorCodeInputModel();
return Page();
}
public async virtual Task<IActionResult> OnPostAsync()
{
var result = await SignInManager.TwoFactorAuthenticatorSignInAsync(Input.VerifyCode, RememberMe, RememberBrowser);
if (result.Succeeded)
{
return await RedirectSafelyAsync(ReturnUrl, ReturnUrlHash);
}
if (result.IsLockedOut)
{
Logger.LogWarning(7, "User account locked out.");
Alerts.Warning(L["UserLockedOutMessage"]);
return Page();
}
else
{
Alerts.Danger(L["TwoFactorAuthenticationInvaidUser"]);// TODO: ¸ü¶à״̬ÂëµÄ½â¶Á
return Page();
}
}
}
public class VerifyAuthenticatorCodeInputModel
{
[Required]
public string VerifyCode { get; set; }
}
}

29
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyCode.cshtml

@ -1,29 +0,0 @@
@page
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LY.MicroService.IdentityServer.Pages.Account.VerifyCodeModel
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<form method="post" class="mt-4">
<input asp-for="Provider" />
<input asp-for="ReturnUrl" />
<input asp-for="ReturnUrlHash" />
<input asp-for="RememberMe" />
<div class="form-group">
<abp-input asp-for="Input.VerifyCode" label="@L["VerifyCode"].Value" class="form-control" />
</div>
<abp-row>
<abp-column>
<abp-input asp-for="Input.RememberBrowser" label="@L["RememberBrowser"].Value" />
</abp-column>
</abp-row>
<div class="d-grid gap-2">
<abp-button type="submit" button-type="Primary" class="mt-2 mb-3">@L["VerifyAuthenticatorCode"]</abp-button>
</div>
<a asp-page="./SendCode" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})">
<i class="fa fa-long-arrow-left"></i> @L["ReSendVerifyCode"]
</a>
</form>
</div>
</div>

92
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Account/VerifyCode.cshtml.cs

@ -1,92 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web.Pages.Account;
namespace LY.MicroService.IdentityServer.Pages.Account
{
public class VerifyCodeModel : AccountPageModel
{
[BindProperty]
public VerifyCodeInputModel Input { get; set; }
/// <summary>
/// 双因素认证提供程序
/// </summary>
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string Provider { get; set; }
/// <summary>
/// 重定向Url
/// </summary>
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrl { get; set; }
/// <summary>
///
/// </summary>
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ReturnUrlHash { get; set; }
/// <summary>
/// 是否记住登录状态
/// </summary>
[HiddenInput]
[BindProperty(SupportsGet = true)]
public bool RememberMe { get; set; }
public VerifyCodeModel()
{
LocalizationResourceType = typeof(AccountResource);
}
public virtual IActionResult OnGet()
{
Input = new VerifyCodeInputModel();
return Page();
}
public async virtual Task<IActionResult> OnPostAsync()
{
// 验证用户登录状态
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
Alerts.Warning(L["TwoFactorAuthenticationInvaidUser"]);
return Page();
}
// 双因素登录
var result = await SignInManager.TwoFactorSignInAsync(Provider, Input.VerifyCode, RememberMe, Input.RememberBrowser);
if (result.Succeeded)
{
return await RedirectSafelyAsync(ReturnUrl, ReturnUrlHash);
}
if (result.IsLockedOut)
{
Logger.LogWarning(7, "User account locked out.");
Alerts.Warning(L["UserLockedOutMessage"]);
return Page();
}
else
{
Alerts.Danger(L["TwoFactorAuthenticationInvaidUser"]);// TODO: 更多状态码的解读
return Page();
}
}
}
public class VerifyCodeInputModel
{
/// <summary>
/// 是否在浏览器中记住登录状态
/// </summary>
public bool RememberBrowser { get; set; }
/// <summary>
/// 发送的验证码
/// </summary>
[Required]
public string VerifyCode { get; set; }
}
}

9
aspnet-core/services/LY.MicroService.IdentityServer/Pages/Index.cshtml.cs

@ -1,11 +1,10 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace LY.MicroService.IdentityServer.Pages
namespace LY.MicroService.IdentityServer.Pages;
public class IndexModel : AbpPageModel
{
public class IndexModel : AbpPageModel
public void OnGet()
{
public void OnGet()
{
}
}
}

3
aspnet-core/services/LY.MicroService.IdentityServer/Pages/_ViewImports.cshtml

@ -1,5 +1,4 @@
@using Microsoft.Extensions.Configuration
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

31
aspnet-core/services/LY.MicroService.IdentityServer/appsettings.Development.json

@ -6,7 +6,8 @@
"secret": "1q2w3E*",
"nodes": "http://127.0.0.1:5000",
"name": "AuthServer",
"tag": "AuthServer"
"tag": "AuthServer",
"configCacheEncrypt": true
},
"App": {
"CorsOrigins": "http://127.0.0.1:3100",
@ -44,16 +45,10 @@
}
},
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456;SslMode=None",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"AppPlatform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None"
"Default": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"Platform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456;SslMode=None",
"Identity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None",
"Realtime": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None"
},
"CAP": {
"EventBus": {
@ -86,6 +81,12 @@
"Configuration": "127.0.0.1,defaultDatabase=10",
"InstanceName": "LINGYUN.Abp.Application"
},
"RemoteServices": {
"Platform": {
"BaseUrl": "http://127.0.0.1:30025",
"UseCurrentAccessToken": false
}
},
"AuthServer": {
"Authority": "http://127.0.0.1:44385/",
"Audience": "lingyun-abp-application",
@ -132,11 +133,11 @@
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Default": "Information",
"Override": {
"System": "Debug",
"Microsoft": "Debug",
"DotNetCore": "Debug"
"System": "Warning",
"Microsoft": "Warning",
"DotNetCore": "Information"
}
},
"WriteTo": [

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save