Browse Source

Merge pull request #129 from colinin/3.3

Add a two-factor authentication feature
pull/177/head
cKey 5 years ago
committed by GitHub
parent
commit
77c5963ea0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      aspnet-core/LINGYUN.MicroService.Common.sln
  2. 75
      aspnet-core/LINGYUN.MicroService.IdentityServer.sln
  3. 16
      aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountUrlNames.cs
  4. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj
  5. 28
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs
  6. 29
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj
  7. 7
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/LINGYUN.Abp.Account.Web.csproj.user
  8. 22
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml
  9. 94
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs
  10. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/UseRecoveryCode.cshtml
  11. 16
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/UseRecoveryCode.cshtml.cs
  12. 20
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml
  13. 55
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs
  14. 20
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml
  15. 65
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs
  16. 71
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/css/site.css
  17. BIN
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/favicon.ico
  18. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/js/site.js
  19. 22
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/LICENSE
  20. 3719
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css
  21. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css.map
  22. 7
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css
  23. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css.map
  24. 331
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css
  25. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css.map
  26. 8
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css
  27. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map
  28. 10038
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.css
  29. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map
  30. 7
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css
  31. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map
  32. 7013
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js
  33. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js.map
  34. 7
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js
  35. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map
  36. 4435
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.js
  37. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.js.map
  38. 7
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js
  39. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js.map
  40. 12
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt
  41. 432
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js
  42. 5
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js
  43. 22
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/LICENSE.md
  44. 1158
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/additional-methods.js
  45. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/additional-methods.min.js
  46. 1601
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/jquery.validate.js
  47. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
  48. 36
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/LICENSE.txt
  49. 10872
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/dist/jquery.js
  50. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/dist/jquery.min.js
  51. 1
      aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/dist/jquery.min.map
  52. 19
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/AbpNotificationsSmsModule.cs
  53. 18
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj
  54. 14
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/IUserPhoneFinder.cs
  55. 10
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NotificationSmsOptions.cs
  56. 18
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NullUserPhoneFinder.cs
  57. 73
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationPublishProvider.cs
  58. 1
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/Localization/WeChatValidator/en.json
  59. 1
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/Localization/WeChatValidator/zh-Hans.json
  60. 4
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatOpenIdFinder.cs
  61. 20
      aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs
  62. 20
      aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
  63. 107
      aspnet-core/services/account/AuthServer.Host/Emailing/AccountEmailVerifySender.cs
  64. 18
      aspnet-core/services/account/AuthServer.Host/Emailing/IAccountEmailVerifySender.cs
  65. 22
      aspnet-core/services/account/AuthServer.Host/Emailing/Templates/AccountEmailTemplateDefinitionProvider.cs
  66. 10
      aspnet-core/services/account/AuthServer.Host/Emailing/Templates/AccountEmailTemplates.cs
  67. 5
      aspnet-core/services/account/AuthServer.Host/Emailing/Templates/MailSecurityVerify.tpl
  68. 18
      aspnet-core/services/account/AuthServer.Host/Localization/Resources/en.json
  69. 18
      aspnet-core/services/account/AuthServer.Host/Localization/Resources/zh-Hans.json
  70. 21
      aspnet-core/services/account/AuthServer.Host/Pages/Account/SendCode.cshtml
  71. 128
      aspnet-core/services/account/AuthServer.Host/Pages/Account/SendCode.cshtml.cs
  72. 42
      aspnet-core/services/account/AuthServer.Host/Pages/Account/TwoFactorSupportedLoginModel.cs
  73. 4
      aspnet-core/services/account/AuthServer.Host/Pages/Account/UseRecoveryCode.cshtml
  74. 16
      aspnet-core/services/account/AuthServer.Host/Pages/Account/UseRecoveryCode.cshtml.cs
  75. 23
      aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyAuthenticatorCode.cshtml
  76. 61
      aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyAuthenticatorCode.cshtml.cs
  77. 24
      aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyCode.cshtml
  78. 92
      aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyCode.cshtml.cs

7
aspnet-core/LINGYUN.MicroService.Common.sln

@ -89,6 +89,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.Db
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.RemoteService", "modules\tenants\LINGYUN.Abp.MultiTenancy.RemoteService\LINGYUN.Abp.MultiTenancy.RemoteService.csproj", "{21C0A260-BC14-4A8F-9299-A9EE58682B96}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.RemoteService", "modules\tenants\LINGYUN.Abp.MultiTenancy.RemoteService\LINGYUN.Abp.MultiTenancy.RemoteService.csproj", "{21C0A260-BC14-4A8F-9299-A9EE58682B96}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.Sms", "modules\common\LINGYUN.Abp.Notifications.Sms\LINGYUN.Abp.Notifications.Sms.csproj", "{15FC0C39-A604-491F-91F6-BD44167FC5F6}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -231,6 +233,10 @@ Global
{21C0A260-BC14-4A8F-9299-A9EE58682B96}.Debug|Any CPU.Build.0 = Debug|Any CPU {21C0A260-BC14-4A8F-9299-A9EE58682B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21C0A260-BC14-4A8F-9299-A9EE58682B96}.Release|Any CPU.ActiveCfg = Release|Any CPU {21C0A260-BC14-4A8F-9299-A9EE58682B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21C0A260-BC14-4A8F-9299-A9EE58682B96}.Release|Any CPU.Build.0 = Release|Any CPU {21C0A260-BC14-4A8F-9299-A9EE58682B96}.Release|Any CPU.Build.0 = Release|Any CPU
{15FC0C39-A604-491F-91F6-BD44167FC5F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15FC0C39-A604-491F-91F6-BD44167FC5F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15FC0C39-A604-491F-91F6-BD44167FC5F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15FC0C39-A604-491F-91F6-BD44167FC5F6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -278,6 +284,7 @@ Global
{F2DAA5EB-5508-4D99-AE64-A10C025712BC} = {38E21687-5F19-42C9-9D11-4B1D2EF64EDB} {F2DAA5EB-5508-4D99-AE64-A10C025712BC} = {38E21687-5F19-42C9-9D11-4B1D2EF64EDB}
{BD0A1F2D-7667-45F8-872D-D41F36384163} = {38E21687-5F19-42C9-9D11-4B1D2EF64EDB} {BD0A1F2D-7667-45F8-872D-D41F36384163} = {38E21687-5F19-42C9-9D11-4B1D2EF64EDB}
{21C0A260-BC14-4A8F-9299-A9EE58682B96} = {38E21687-5F19-42C9-9D11-4B1D2EF64EDB} {21C0A260-BC14-4A8F-9299-A9EE58682B96} = {38E21687-5F19-42C9-9D11-4B1D2EF64EDB}
{15FC0C39-A604-491F-91F6-BD44167FC5F6} = {B91F26C5-B148-4094-B5F1-71E5F945DBED}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8} SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8}

75
aspnet-core/LINGYUN.MicroService.IdentityServer.sln

@ -23,6 +23,32 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{AF8AEC
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Authorization", "modules\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj", "{F656C1B2-6122-44C1-97F4-421CB4C03ED8}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Authorization", "modules\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj", "{F656C1B2-6122-44C1-97F4-421CB4C03ED8}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "account", "account", "{09C7BFF7-BCCB-4E02-8DAE-3B047A68011D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.Domain.Shared", "modules\account\LINGYUN.Abp.Account.Domain.Shared\LINGYUN.Abp.Account.Domain.Shared.csproj", "{495A110A-8034-409B-A036-28CDF2CA9386}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.Domain", "modules\account\LINGYUN.Abp.Account.Domain\LINGYUN.Abp.Account.Domain.csproj", "{650FE9CC-4A55-4F2C-A82C-EF10DEB32DF0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "permission-management", "permission-management", "{2FEA83BA-2E6D-40AF-8781-12CFD042457F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Domain\LINGYUN.Abp.PermissionManagement.Domain.csproj", "{A0A11373-635B-4343-8EE7-1DFC3611F05A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat", "modules\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj", "{6F13C138-1D71-48F5-A404-94047242E98F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{572DBB40-4637-4C01-8491-8686F7E22B45}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.EventBus.CAP", "modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj", "{843012AC-78C3-4A25-904C-353ED26C8524}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.DbFinder", "modules\tenants\LINGYUN.Abp.MultiTenancy.DbFinder\LINGYUN.Abp.MultiTenancy.DbFinder.csproj", "{FEEA68C2-D545-4AD6-81C7-71D0E2747CC3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy", "modules\tenants\LINGYUN.Abp.MultiTenancy\LINGYUN.Abp.MultiTenancy.csproj", "{D879BE04-BEFC-423B-868C-E8BA10605E16}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tenants", "tenants", "{6CB9D0F3-8D50-49B5-98E2-D777717E51E8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Aliyun.Authorization", "modules\common\LINGYUN.Abp.Aliyun.Authorization\LINGYUN.Abp.Aliyun.Authorization.csproj", "{C675C7DB-5825-4F64-BF76-8A4452A448D2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Sms.Aliyun", "modules\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj", "{A51E2EB5-EEC0-4FB0-99B9-A0FBE0D8B0EB}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -49,6 +75,42 @@ Global
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU {F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU {F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Release|Any CPU.Build.0 = Release|Any CPU {F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Release|Any CPU.Build.0 = Release|Any CPU
{495A110A-8034-409B-A036-28CDF2CA9386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{495A110A-8034-409B-A036-28CDF2CA9386}.Debug|Any CPU.Build.0 = Debug|Any CPU
{495A110A-8034-409B-A036-28CDF2CA9386}.Release|Any CPU.ActiveCfg = Release|Any CPU
{495A110A-8034-409B-A036-28CDF2CA9386}.Release|Any CPU.Build.0 = Release|Any CPU
{650FE9CC-4A55-4F2C-A82C-EF10DEB32DF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{650FE9CC-4A55-4F2C-A82C-EF10DEB32DF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{650FE9CC-4A55-4F2C-A82C-EF10DEB32DF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{650FE9CC-4A55-4F2C-A82C-EF10DEB32DF0}.Release|Any CPU.Build.0 = Release|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Release|Any CPU.Build.0 = Release|Any CPU
{6F13C138-1D71-48F5-A404-94047242E98F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F13C138-1D71-48F5-A404-94047242E98F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F13C138-1D71-48F5-A404-94047242E98F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F13C138-1D71-48F5-A404-94047242E98F}.Release|Any CPU.Build.0 = Release|Any CPU
{843012AC-78C3-4A25-904C-353ED26C8524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{843012AC-78C3-4A25-904C-353ED26C8524}.Debug|Any CPU.Build.0 = Debug|Any CPU
{843012AC-78C3-4A25-904C-353ED26C8524}.Release|Any CPU.ActiveCfg = Release|Any CPU
{843012AC-78C3-4A25-904C-353ED26C8524}.Release|Any CPU.Build.0 = Release|Any CPU
{FEEA68C2-D545-4AD6-81C7-71D0E2747CC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FEEA68C2-D545-4AD6-81C7-71D0E2747CC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FEEA68C2-D545-4AD6-81C7-71D0E2747CC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FEEA68C2-D545-4AD6-81C7-71D0E2747CC3}.Release|Any CPU.Build.0 = Release|Any CPU
{D879BE04-BEFC-423B-868C-E8BA10605E16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D879BE04-BEFC-423B-868C-E8BA10605E16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D879BE04-BEFC-423B-868C-E8BA10605E16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D879BE04-BEFC-423B-868C-E8BA10605E16}.Release|Any CPU.Build.0 = Release|Any CPU
{C675C7DB-5825-4F64-BF76-8A4452A448D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C675C7DB-5825-4F64-BF76-8A4452A448D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C675C7DB-5825-4F64-BF76-8A4452A448D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C675C7DB-5825-4F64-BF76-8A4452A448D2}.Release|Any CPU.Build.0 = Release|Any CPU
{A51E2EB5-EEC0-4FB0-99B9-A0FBE0D8B0EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A51E2EB5-EEC0-4FB0-99B9-A0FBE0D8B0EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A51E2EB5-EEC0-4FB0-99B9-A0FBE0D8B0EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A51E2EB5-EEC0-4FB0-99B9-A0FBE0D8B0EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -62,6 +124,19 @@ Global
{F87B2BA3-40BC-4CB8-B53E-793C860F285D} = {70B8D735-1E89-4163-8EDB-56A74E374CF4} {F87B2BA3-40BC-4CB8-B53E-793C860F285D} = {70B8D735-1E89-4163-8EDB-56A74E374CF4}
{AF8AECC8-0F42-4FC5-B3C0-00987BA8279F} = {7C727110-59CA-495B-8143-C5DDEDE41289} {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{F656C1B2-6122-44C1-97F4-421CB4C03ED8} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F} {F656C1B2-6122-44C1-97F4-421CB4C03ED8} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}
{09C7BFF7-BCCB-4E02-8DAE-3B047A68011D} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{495A110A-8034-409B-A036-28CDF2CA9386} = {09C7BFF7-BCCB-4E02-8DAE-3B047A68011D}
{650FE9CC-4A55-4F2C-A82C-EF10DEB32DF0} = {09C7BFF7-BCCB-4E02-8DAE-3B047A68011D}
{2FEA83BA-2E6D-40AF-8781-12CFD042457F} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{A0A11373-635B-4343-8EE7-1DFC3611F05A} = {2FEA83BA-2E6D-40AF-8781-12CFD042457F}
{6F13C138-1D71-48F5-A404-94047242E98F} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}
{572DBB40-4637-4C01-8491-8686F7E22B45} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{843012AC-78C3-4A25-904C-353ED26C8524} = {572DBB40-4637-4C01-8491-8686F7E22B45}
{FEEA68C2-D545-4AD6-81C7-71D0E2747CC3} = {6CB9D0F3-8D50-49B5-98E2-D777717E51E8}
{D879BE04-BEFC-423B-868C-E8BA10605E16} = {6CB9D0F3-8D50-49B5-98E2-D777717E51E8}
{6CB9D0F3-8D50-49B5-98E2-D777717E51E8} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{C675C7DB-5825-4F64-BF76-8A4452A448D2} = {572DBB40-4637-4C01-8491-8686F7E22B45}
{A51E2EB5-EEC0-4FB0-99B9-A0FBE0D8B0EB} = {572DBB40-4637-4C01-8491-8686F7E22B45}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FCB77471-9ECB-4666-A316-1D6A6285A468} SolutionGuid = {FCB77471-9ECB-4666-A316-1D6A6285A468}

16
aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/AccountUrlNames.cs

@ -0,0 +1,16 @@
namespace LINGYUN.Abp.Account
{
/// <summary>
/// 定义账户系统Url
/// </summary>
/// <remarks>
/// 定义在领域共享层,可以方便其他应用程序调用
/// </remarks>
public static class AccountUrlNames
{
/// <summary>
/// 邮件登录验证地址
/// </summary>
public static string MailLoginVerify { get; set; } = "";
}
}

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Domain/LINGYUN.Abp.Account.Domain.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" /> <Import Project="..\..\..\common.props" />

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

@ -1,9 +1,33 @@
using Volo.Abp.Modularity; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Emailing;
using Volo.Abp.Modularity;
using Volo.Abp.Sms;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Account.Web namespace LINGYUN.Abp.Account.Web
{ {
[DependsOn(typeof(Volo.Abp.Account.Web.AbpAccountWebModule))] [DependsOn(
typeof(AbpSmsModule),
typeof(AbpEmailingModule),
typeof(Volo.Abp.Account.Web.AbpAccountWebModule))]
public class AbpAccountWebModule : AbpModule public class AbpAccountWebModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAccountWebModule>();
});
context.Services
.AddAuthorization(options =>
{
options
.AddPolicy("TwoFactorEnabled", policy =>
{
policy.RequireClaim("amr", "mfa");
});
});
}
} }
} }

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

@ -1,35 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\common.props" /> <Import Project="..\..\..\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>LINGYUN.Abp.Account.Web</AssemblyName> <AssemblyName>LINGYUN.Abp.Account.Web</AssemblyName>
<PackageId>LINGYUN.Abp.Account.Web</PackageId> <PackageId>LINGYUN.Abp.Account.Web</PackageId>
<IsPackable>true</IsPackable>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> <AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<RootNamespace>LINGYUN.Abp.Account.Web</RootNamespace> <RootNamespace>LINGYUN.Abp.Account.Web</RootNamespace>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Pages\**\*.js" /> <EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.css" /> <EmbeddedResource Include="Pages\**\*.js" />
<Content Remove="Pages\**\*.js" /> <EmbeddedResource Include="Components\**\*.js" />
<Content Remove="Pages\**\*.css" /> <EmbeddedResource Include="Components\**\*.css" />
</ItemGroup> <Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Components\**\*.js" />
<Content Remove="Components\**\*.css" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Account.Web" Version="3.3.0" /> <PackageReference Include="Volo.Abp.Account.Web" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Sms" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Emailing" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.8" /> <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.1.8" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Pages\Account\" />
</ItemGroup>
</Project> </Project>

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

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RazorPage_SelectedScaffolderID>RazorPageScaffolder</RazorPage_SelectedScaffolderID>
<RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
</PropertyGroup>
</Project>

22
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml

@ -0,0 +1,22 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LINGYUN.Abp.Account.Web.Pages.Account.SendCodeModel
@inject IHtmlLocalizer<AccountResource> L
<div class="card mt-3 shadow-sm rounded">
<div class="card-body p-5">
<h4>@L["SendTwoFactor"]</h4>
<form method="post" class="mt-4">
<input asp-for="SendCodeInput.RememberMe" type="hidden" />
<input asp-for="SendCodeInput.ReturnUrl" type="hidden" />
<div class="form-group">
<label asp-for="@L["SelectProvider"]"></label>
<abp-select asp-for="SendCodeInput.SelectedProvider" asp-items="Model.SendCodeInput.Providers"></abp-select>
</div>
<abp-button type="submit" button-type="Primary" class="btn-block btn-lg mt-3">@L["SendTwoFactorCode"]</abp-button>
</form>
</div>
</div>

94
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs

@ -0,0 +1,94 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.Emailing;
using Volo.Abp.Sms;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class SendCodeModel : AccountPageModel
{
[BindProperty]
public SendCodeInputModel SendCodeInput { get; set; }
protected ISmsSender SmsSender { get; }
protected IEmailSender EmailSender { get; }
public virtual IActionResult OnGet()
{
SendCodeInput = new SendCodeInputModel();
return Page();
}
public virtual async Task<IActionResult> OnPostAsync()
{
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
Alerts.Warning("双因素认证失败,用户未登录!");
return Page();
}
if (SendCodeInput.SelectedProvider == "Authenticator")
{
var verifyAuthenticatorCodeInput = new VerifyAuthenticatorCodeInputModel
{
ReturnUrl = SendCodeInput.ReturnUrl,
RememberMe = SendCodeInput.RememberMe
};
return RedirectToPage("VerifyAuthenticatorCode", verifyAuthenticatorCodeInput);
}
var code = await UserManager.GenerateTwoFactorTokenAsync(user, SendCodeInput.SelectedProvider);
if (string.IsNullOrWhiteSpace(code))
{
Alerts.Warning("验证码生成失败,请联系系统管理员!");
return Page();
}
var message = "Your security code is: " + code;
if (SendCodeInput.SelectedProvider == "Email")
{
await EmailSender.SendAsync(await UserManager.GetEmailAsync(user), "Security Code", message);
}
else if (SendCodeInput.SelectedProvider == "Phone")
{
await SmsSender.SendAsync(await UserManager.GetPhoneNumberAsync(user), message);
}
var verifyCodeInput = new VerifyCodeInputModel
{
Provider = SendCodeInput.SelectedProvider,
ReturnUrl = SendCodeInput.ReturnUrl,
RememberMe = SendCodeInput.RememberMe
};
return RedirectToPage("VerifyCode", verifyCodeInput);
}
}
public class SendCodeInputModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
public string ReturnUrl { get; set; }
public bool RememberMe { get; set; }
}
public class TwoFactorInputModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
public string ReturnUrl { get; set; }
public bool RememberMe { get; set; }
}
}

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
@{
}

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

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

20
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml

@ -0,0 +1,20 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LINGYUN.Abp.Account.Web.Pages.Account.VerifyAuthenticatorCodeModel
@inject IHtmlLocalizer<AccountResource> L
<form method="post" class="mt-4">
<input asp-for="Input.RememberMe" type="hidden" />
<div class="form-group">
<label asp-for="Input.Code"></label>
<input asp-for="Input.Code" class="form-control" />
<span asp-validation-for="Input.Code" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Input.RememberBrowser"></label>
<abp-input asp-for="Input.RememberBrowser" />
</div>
<abp-button type="submit" button-type="Primary" class="btn-block btn-lg mt-3">@L["VerifyAuthenticatorCode"]</abp-button>
</form>

55
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs

@ -0,0 +1,55 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class VerifyAuthenticatorCodeModel : AccountPageModel
{
[BindProperty]
public VerifyAuthenticatorCodeInputModel Input { get; set; }
public virtual IActionResult OnGet()
{
Input = new VerifyAuthenticatorCodeInputModel();
return Page();
}
public virtual async Task<IActionResult> OnPostAsync()
{
var result = await SignInManager.TwoFactorAuthenticatorSignInAsync(Input.Code, Input.RememberMe, Input.RememberBrowser);
if (result.Succeeded)
{
return RedirectSafely(Input.ReturnUrl);
}
if (result.IsLockedOut)
{
Logger.LogWarning(7, "User account locked out.");
Alerts.Warning(L["UserLockedOutMessage"]);
return Page();
}
else
{
Alerts.Danger("ÊÚȨÂëÑéÖ¤ÎÞЧ!");
return Page();
}
}
}
public class VerifyAuthenticatorCodeInputModel
{
[Required]
public string Code { get; set; }
public string ReturnUrl { get; set; }
[Display(Name = "Remember this browser?")]
public bool RememberBrowser { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
}

20
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml

@ -0,0 +1,20 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LINGYUN.Abp.Account.Web.Pages.Account.VerifyCodeModel
@inject IHtmlLocalizer<AccountResource> L
<form method="post" class="mt-4">
<input asp-for="Input.Provider" type="hidden" />
<input asp-for="Input.RememberMe" type="hidden" />
<div class="form-group">
<label asp-for="Input.Code"></label>
<input asp-for="Input.Code" class="form-control" />
<span asp-validation-for="Input.Code" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Input.RememberBrowser"></label>
<abp-input asp-for="Input.RememberBrowser" />
</div>
<abp-button type="submit" button-type="Primary" class="btn-block btn-lg mt-3">@L["VerifyCode"]</abp-button>
</form>

65
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs

@ -0,0 +1,65 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LINGYUN.Abp.Account.Web.Pages.Account
{
public class VerifyCodeModel : AccountPageModel
{
[BindProperty]
public VerifyCodeInputModel Input { get; set; }
public virtual IActionResult OnGet()
{
Input = new VerifyCodeInputModel();
return Page();
}
public virtual async Task<IActionResult> OnPostAsync()
{
var user = await SignInManager.GetTwoFactorAuthenticationUserAsync();
if (user == null)
{
Alerts.Warning("双因素认证失败,用户未登录或已失效!");
return Page();
}
var result = await SignInManager.TwoFactorSignInAsync(Input.Provider, Input.Code, Input.RememberMe, Input.RememberBrowser);
if (result.Succeeded)
{
return RedirectSafely(Input.ReturnUrl);
}
if (result.IsLockedOut)
{
Logger.LogWarning(7, "User account locked out.");
Alerts.Warning(L["UserLockedOutMessage"]);
return Page();
}
else
{
Alerts.Danger("授权码验证无效!");
return Page();
}
}
}
public class VerifyCodeInputModel
{
[Required]
public string Provider { get; set; }
[Required]
public string Code { get; set; }
public string ReturnUrl { get; set; }
[Display(Name = "Remember this browser?")]
public bool RememberBrowser { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
}

71
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/css/site.css

@ -1,71 +0,0 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
/* Provide sufficient contrast against white background */
a {
color: #0366d6;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
/* Sticky footer styles
-------------------------------------------------- */
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px; /* Vertically center the text there */
}

BIN
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/js/site.js

@ -1,4 +0,0 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your Javascript code.

22
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/LICENSE

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2011-2018 Twitter, Inc.
Copyright (c) 2011-2018 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

3719
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css

File diff suppressed because it is too large

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css.map

File diff suppressed because one or more lines are too long

7
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css

File diff suppressed because one or more lines are too long

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css.map

File diff suppressed because one or more lines are too long

331
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css

@ -1,331 +0,0 @@
/*!
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
outline: 0;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg {
overflow: hidden;
vertical-align: middle;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: 0.5rem;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
select {
word-wrap: normal;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
cursor: pointer;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css.map

File diff suppressed because one or more lines are too long

8
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css

@ -1,8 +0,0 @@
/*!
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map

File diff suppressed because one or more lines are too long

10038
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.css

File diff suppressed because it is too large

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map

File diff suppressed because one or more lines are too long

7
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css

File diff suppressed because one or more lines are too long

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map

File diff suppressed because one or more lines are too long

7013
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js

File diff suppressed because it is too large

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js.map

File diff suppressed because one or more lines are too long

7
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js

File diff suppressed because one or more lines are too long

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map

File diff suppressed because one or more lines are too long

4435
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.js

File diff suppressed because it is too large

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.js.map

File diff suppressed because one or more lines are too long

7
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js

File diff suppressed because one or more lines are too long

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js.map

File diff suppressed because one or more lines are too long

12
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt

@ -1,12 +0,0 @@
Copyright (c) .NET Foundation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

432
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js

@ -1,432 +0,0 @@
// Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports
module.exports = factory(require('jquery-validation'));
} else {
// Browser global
jQuery.validator.unobtrusive = factory(jQuery);
}
}(function ($) {
var $jQval = $.validator,
adapters,
data_validation = "unobtrusiveValidation";
function setValidationValues(options, ruleName, value) {
options.rules[ruleName] = value;
if (options.message) {
options.messages[ruleName] = options.message;
}
}
function splitAndTrim(value) {
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
}
function escapeAttributeValue(value) {
// As mentioned on http://api.jquery.com/category/selectors/
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
}
function getModelPrefix(fieldName) {
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
}
function appendModelPrefix(value, prefix) {
if (value.indexOf("*.") === 0) {
value = value.replace("*.", prefix);
}
return value;
}
function onError(error, inputElement) { // 'this' is the form element
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container);
if (replace) {
container.empty();
error.removeClass("input-validation-error").appendTo(container);
}
else {
error.hide();
}
}
function onErrors(event, validator) { // 'this' is the form element
var container = $(this).find("[data-valmsg-summary=true]"),
list = container.find("ul");
if (list && list.length && validator.errorList.length) {
list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
$.each(validator.errorList, function () {
$("<li />").html(this.message).appendTo(list);
});
}
}
function onSuccess(error) { // 'this' is the form element
var container = error.data("unobtrusiveContainer");
if (container) {
var replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
container.addClass("field-validation-valid").removeClass("field-validation-error");
error.removeData("unobtrusiveContainer");
if (replace) {
container.empty();
}
}
}
function onReset(event) { // 'this' is the form element
var $form = $(this),
key = '__jquery_unobtrusive_validation_form_reset';
if ($form.data(key)) {
return;
}
// Set a flag that indicates we're currently resetting the form.
$form.data(key, true);
try {
$form.data("validator").resetForm();
} finally {
$form.removeData(key);
}
$form.find(".validation-summary-errors")
.addClass("validation-summary-valid")
.removeClass("validation-summary-errors");
$form.find(".field-validation-error")
.addClass("field-validation-valid")
.removeClass("field-validation-error")
.removeData("unobtrusiveContainer")
.find(">*") // If we were using valmsg-replace, get the underlying error
.removeData("unobtrusiveContainer");
}
function validationInfo(form) {
var $form = $(form),
result = $form.data(data_validation),
onResetProxy = $.proxy(onReset, form),
defaultOptions = $jQval.unobtrusive.options || {},
execInContext = function (name, args) {
var func = defaultOptions[name];
func && $.isFunction(func) && func.apply(form, args);
};
if (!result) {
result = {
options: { // options structure passed to jQuery Validate's validate() method
errorClass: defaultOptions.errorClass || "input-validation-error",
errorElement: defaultOptions.errorElement || "span",
errorPlacement: function () {
onError.apply(form, arguments);
execInContext("errorPlacement", arguments);
},
invalidHandler: function () {
onErrors.apply(form, arguments);
execInContext("invalidHandler", arguments);
},
messages: {},
rules: {},
success: function () {
onSuccess.apply(form, arguments);
execInContext("success", arguments);
}
},
attachValidation: function () {
$form
.off("reset." + data_validation, onResetProxy)
.on("reset." + data_validation, onResetProxy)
.validate(this.options);
},
validate: function () { // a validation function that is called by unobtrusive Ajax
$form.validate();
return $form.valid();
}
};
$form.data(data_validation, result);
}
return result;
}
$jQval.unobtrusive = {
adapters: [],
parseElement: function (element, skipAttach) {
/// <summary>
/// Parses a single HTML element for unobtrusive validation attributes.
/// </summary>
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
/// validation to the form. If parsing just this single element, you should specify true.
/// If parsing several elements, you should specify false, and manually attach the validation
/// to the form when you are finished. The default is false.</param>
var $element = $(element),
form = $element.parents("form")[0],
valInfo, rules, messages;
if (!form) { // Cannot do client-side validation without a form
return;
}
valInfo = validationInfo(form);
valInfo.options.rules[element.name] = rules = {};
valInfo.options.messages[element.name] = messages = {};
$.each(this.adapters, function () {
var prefix = "data-val-" + this.name,
message = $element.attr(prefix),
paramValues = {};
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
prefix += "-";
$.each(this.params, function () {
paramValues[this] = $element.attr(prefix + this);
});
this.adapt({
element: element,
form: form,
message: message,
params: paramValues,
rules: rules,
messages: messages
});
}
});
$.extend(rules, { "__dummy__": true });
if (!skipAttach) {
valInfo.attachValidation();
}
},
parse: function (selector) {
/// <summary>
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
/// attribute values.
/// </summary>
/// <param name="selector" type="String">Any valid jQuery selector.</param>
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
// element with data-val=true
var $selector = $(selector),
$forms = $selector.parents()
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
$selector.find("[data-val=true]").each(function () {
$jQval.unobtrusive.parseElement(this, true);
});
$forms.each(function () {
var info = validationInfo(this);
if (info) {
info.attachValidation();
}
});
}
};
adapters = $jQval.unobtrusive.adapters;
adapters.add = function (adapterName, params, fn) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
/// mmmm is the parameter name).</param>
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
/// attributes into jQuery Validate rules and/or messages.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
if (!fn) { // Called with no params, just a function
fn = params;
params = [];
}
this.push({ name: adapterName, params: params, adapt: fn });
return this;
};
adapters.addBool = function (adapterName, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has no parameter values.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, function (options) {
setValidationValues(options, ruleName || adapterName, true);
});
};
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a minimum value.</param>
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a maximum value.</param>
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
/// have both a minimum and maximum value.</param>
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the minimum value. The default is "min".</param>
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the maximum value. The default is "max".</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
var min = options.params.min,
max = options.params.max;
if (min && max) {
setValidationValues(options, minMaxRuleName, [min, max]);
}
else if (min) {
setValidationValues(options, minRuleName, min);
}
else if (max) {
setValidationValues(options, maxRuleName, max);
}
});
};
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has a single value.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
/// The default is "val".</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [attribute || "val"], function (options) {
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
});
};
$jQval.addMethod("__dummy__", function (value, element, params) {
return true;
});
$jQval.addMethod("regex", function (value, element, params) {
var match;
if (this.optional(element)) {
return true;
}
match = new RegExp(params).exec(value);
return (match && (match.index === 0) && (match[0].length === value.length));
});
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
var match;
if (nonalphamin) {
match = value.match(/\W/g);
match = match && match.length >= nonalphamin;
}
return match;
});
if ($jQval.methods.extension) {
adapters.addSingleVal("accept", "mimtype");
adapters.addSingleVal("extension", "extension");
} else {
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
// validating the extension, and ignore mime-type validations as they are not supported.
adapters.addSingleVal("extension", "extension", "accept");
}
adapters.addSingleVal("regex", "pattern");
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
adapters.add("equalto", ["other"], function (options) {
var prefix = getModelPrefix(options.element.name),
other = options.params.other,
fullOtherName = appendModelPrefix(other, prefix),
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
setValidationValues(options, "equalTo", element);
});
adapters.add("required", function (options) {
// jQuery Validate equates "required" with "mandatory" for checkbox elements
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
setValidationValues(options, "required", true);
}
});
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
var value = {
url: options.params.url,
type: options.params.type || "GET",
data: {}
},
prefix = getModelPrefix(options.element.name);
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
var paramName = appendModelPrefix(fieldName, prefix);
value.data[paramName] = function () {
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
// For checkboxes and radio buttons, only pick up values from checked fields.
if (field.is(":checkbox")) {
return field.filter(":checked").val() || field.filter(":hidden").val() || '';
}
else if (field.is(":radio")) {
return field.filter(":checked").val() || '';
}
return field.val();
};
});
setValidationValues(options, "remote", value);
});
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
if (options.params.min) {
setValidationValues(options, "minlength", options.params.min);
}
if (options.params.nonalphamin) {
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
}
if (options.params.regex) {
setValidationValues(options, "regex", options.params.regex);
}
});
adapters.add("fileextensions", ["extensions"], function (options) {
setValidationValues(options, "extension", options.params.extensions);
});
$(function () {
$jQval.unobtrusive.parse(document);
});
return $jQval.unobtrusive;
}));

5
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js

File diff suppressed because one or more lines are too long

22
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/LICENSE.md

@ -1,22 +0,0 @@
The MIT License (MIT)
=====================
Copyright Jörn Zaefferer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

1158
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/additional-methods.js

File diff suppressed because it is too large

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/additional-methods.min.js

File diff suppressed because one or more lines are too long

1601
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/jquery.validate.js

File diff suppressed because it is too large

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js

File diff suppressed because one or more lines are too long

36
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/LICENSE.txt

@ -1,36 +0,0 @@
Copyright JS Foundation and other contributors, https://js.foundation/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.

10872
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/dist/jquery.js

File diff suppressed because it is too large

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/dist/jquery.min.js

File diff suppressed because one or more lines are too long

1
aspnet-core/modules/account/LINGYUN.Abp.Account.Web/wwwroot/lib/jquery/dist/jquery.min.map

File diff suppressed because one or more lines are too long

19
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/AbpNotificationsSmsModule.cs

@ -0,0 +1,19 @@
using Volo.Abp.Modularity;
using Volo.Abp.Sms;
namespace LINGYUN.Abp.Notifications.Sms
{
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpSmsModule))]
public class AbpNotificationsSmsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNotificationOptions>(options =>
{
options.PublishProviders.Add<SmsNotificationPublishProvider>();
});
}
}
}

18
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Sms" Version="3.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
</ItemGroup>
</Project>

14
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/IUserPhoneFinder.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Notifications.Sms
{
public interface IUserPhoneFinder
{
Task<IEnumerable<string>> FindByUserIdsAsync(
IEnumerable<Guid> userIds,
CancellationToken cancellation = default);
}
}

10
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NotificationSmsOptions.cs

@ -0,0 +1,10 @@
namespace LINGYUN.Abp.Notifications.Sms
{
public class NotificationSmsOptions
{
/// <summary>
/// 短信模板变量前缀
/// </summary>
public string TemplateParamsPrefix { get; set; } = "[sms]";
}
}

18
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NullUserPhoneFinder.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Notifications.Sms
{
public class NullUserPhoneFinder : IUserPhoneFinder, ISingletonDependency
{
public Task<IEnumerable<string>> FindByUserIdsAsync(IEnumerable<Guid> userIds, CancellationToken cancellation = default)
{
IEnumerable<string> emptyPhoneList = new string[0];
return Task.FromResult(emptyPhoneList);
}
}
}

73
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationPublishProvider.cs

@ -0,0 +1,73 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Sms;
namespace LINGYUN.Abp.Notifications.Sms
{
public class SmsNotificationPublishProvider : NotificationPublishProvider
{
private IUserPhoneFinder _userPhoneFinder;
protected IUserPhoneFinder UserPhoneFinder => LazyGetRequiredService(ref _userPhoneFinder);
private ISmsSender _smsSender;
protected ISmsSender SmsSender => LazyGetRequiredService(ref _smsSender);
protected NotificationSmsOptions Options { get; }
public SmsNotificationPublishProvider(
IServiceProvider serviceProvider,
IOptions<NotificationSmsOptions> options)
: base(serviceProvider)
{
Options = options.Value;
}
public override string Name => "Sms";
protected override async Task PublishAsync(
NotificationInfo notification,
IEnumerable<UserIdentifier> identifiers,
CancellationToken cancellationToken = default)
{
if (!identifiers.Any())
{
return;
}
var templateCode = notification.Data.TryGetData("TemplateCode");
if (templateCode == null)
{
Logger.LogWarning("sms template code is empty, can not send sms message!");
return;
}
var sendToPhones = await UserPhoneFinder.FindByUserIdsAsync(identifiers.Select(usr => usr.UserId), cancellationToken);
if (!sendToPhones.Any())
{
return;
}
var message = new SmsMessage(sendToPhones.JoinAsString(","), "SmsNotification");
// TODO: 后期增强功能,增加短信模板、通知模板功能
message.Properties.Add("TemplateCode", templateCode);
message.Properties.Add("SignName", notification.Data.TryGetData("SignName"));
foreach (var property in notification.Data.Properties)
{
// TODO: 可以扩展下存储短信模板,根据模板变量自动匹配
// 必须加上需要发送短信的前缀让用户自己选择是否发送短信,因为资费太贵了...
if (property.Key.StartsWith(Options.TemplateParamsPrefix))
{
message.Properties.Add(property.Key.Replace(Options.TemplateParamsPrefix, ""), property.Value);
}
}
await SmsSender.SendAsync(message);
}
}
}

1
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/Localization/WeChatValidator/en.json

@ -1,6 +1,7 @@
{ {
"culture": "en", "culture": "en",
"texts": { "texts": {
"SelfRegistrationDisabledMessage": "Self-registration is disabled for this application. Please contact the application administrator to register a new user.",
"InvalidGrant:GrantTypeInvalid": "The type of authorization that is not allowed!", "InvalidGrant:GrantTypeInvalid": "The type of authorization that is not allowed!",
"InvalidGrant:WeChatTokenInvalid": "WeChat authentication failed!", "InvalidGrant:WeChatTokenInvalid": "WeChat authentication failed!",
"InvalidGrant:WeChatCodeNotFound": "The code obtained when WeChat is logged in is empty or does not exist!", "InvalidGrant:WeChatCodeNotFound": "The code obtained when WeChat is logged in is empty or does not exist!",

1
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/Localization/WeChatValidator/zh-Hans.json

@ -1,6 +1,7 @@
{ {
"culture": "zh-Hans", "culture": "zh-Hans",
"texts": { "texts": {
"SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户.",
"InvalidGrant:GrantTypeInvalid": "不被允许的授权类型!", "InvalidGrant:GrantTypeInvalid": "不被允许的授权类型!",
"InvalidGrant:WeChatTokenInvalid": "微信认证失败!", "InvalidGrant:WeChatTokenInvalid": "微信认证失败!",
"InvalidGrant:WeChatCodeNotFound": "微信登录时获取的 code 为空或不存在!", "InvalidGrant:WeChatCodeNotFound": "微信登录时获取的 code 为空或不存在!",

4
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatCodeFinder.cs → aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatOpenIdFinder.cs

@ -9,11 +9,11 @@ namespace LINGYUN.Abp.WeChat.Authorization
{ {
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] [Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(IUserWeChatOpenIdFinder))] [ExposeServices(typeof(IUserWeChatOpenIdFinder))]
public class UserWeChatCodeFinder : IUserWeChatOpenIdFinder public class UserWeChatOpenIdFinder : IUserWeChatOpenIdFinder
{ {
protected IdentityUserManager UserManager { get; } protected IdentityUserManager UserManager { get; }
public UserWeChatCodeFinder( public UserWeChatOpenIdFinder(
IdentityUserManager userManager) IdentityUserManager userManager)
{ {
UserManager = userManager; UserManager = userManager;

20
aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs

@ -1,9 +1,10 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using LINGYUN.Abp.Account;
using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.IdentityServer; using LINGYUN.Abp.IdentityServer;
using LINGYUN.Abp.MultiTenancy.DbFinder; using LINGYUN.Abp.MultiTenancy.DbFinder;
using LINGYUN.Abp.PermissionManagement.Identity; using LINGYUN.Abp.PermissionManagement.Identity;
using Microsoft.AspNetCore.Authentication.WeChat; using LINYUN.Abp.Sms.Aliyun;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
@ -18,6 +19,7 @@ using System.Linq;
using System.Text; using System.Text;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account; using Volo.Abp.Account;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web; using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
@ -45,10 +47,12 @@ using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement.EntityFrameworkCore; using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem;
namespace AuthServer.Host namespace AuthServer.Host
{ {
[DependsOn( [DependsOn(
typeof(AbpAccountDomainModule),
typeof(AbpAccountWebIdentityServerModule), typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountApplicationModule), typeof(AbpAccountApplicationModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
@ -70,7 +74,8 @@ namespace AuthServer.Host
typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpDbFinderMultiTenancyModule), typeof(AbpDbFinderMultiTenancyModule),
typeof(AbpCAPEventBusModule) typeof(AbpCAPEventBusModule),
typeof(AbpAliyunSmsModule)
)] )]
public class AuthIdentityServerModule : AbpModule public class AuthIdentityServerModule : AbpModule
{ {
@ -140,10 +145,19 @@ namespace AuthServer.Host
options.InstanceName = configuration["Redis:InstanceName"]; options.InstanceName = configuration["Redis:InstanceName"];
}); });
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AuthIdentityServerModule>("AuthServer");
});
Configure<AbpLocalizationOptions>(options => Configure<AbpLocalizationOptions>(options =>
{ {
options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
options.Resources
.Get<AccountResource>()
.AddVirtualJson("/Localization/Resources");
}); });
Configure<AbpAuditingOptions>(options => Configure<AbpAuditingOptions>(options =>
@ -155,6 +169,8 @@ namespace AuthServer.Host
Configure<AppUrlOptions>(options => Configure<AppUrlOptions>(options =>
{ {
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
// 邮件登录地址
options.Applications["MVC"].Urls[LINGYUN.Abp.Account.AccountUrlNames.MailLoginVerify] = "Account/VerifyCode";
}); });
context.Services.ConfigureNonBreakingSameSiteCookies(); context.Services.ConfigureNonBreakingSameSiteCookies();

20
aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj

@ -1,10 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>AuthServer</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Remove="Localization\Resources\en.json" />
<Content Remove="Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<None Remove="Emailing\Templates\MailSecurityVerify.tpl" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Emailing\Templates\MailSecurityVerify.tpl" />
<EmbeddedResource Include="Localization\Resources\en.json" />
<EmbeddedResource Include="Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="3.0.4" /> <PackageReference Include="DotNetCore.CAP.Dashboard" Version="3.0.4" />
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.4" /> <PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.4" />
@ -38,7 +54,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\modules\account\LINGYUN.Abp.Account.Domain\LINGYUN.Abp.Account.Domain.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" /> <ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.WeChatValidator\LINGYUN.Abp.IdentityServer.WeChatValidator.csproj" /> <ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.WeChatValidator\LINGYUN.Abp.IdentityServer.WeChatValidator.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj" /> <ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj" />
<ProjectReference Include="..\..\..\modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj" /> <ProjectReference Include="..\..\..\modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj" />

107
aspnet-core/services/account/AuthServer.Host/Emailing/AccountEmailVerifySender.cs

@ -0,0 +1,107 @@
using AuthServer.Host.Emailing.Templates;
using LINGYUN.Abp.Account;
using Microsoft.Extensions.Localization;
using System;
using System.Diagnostics;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using System.Web;
using Volo.Abp.Account.Emailing;
using Volo.Abp.Account.Localization;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Emailing;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TextTemplating;
using Volo.Abp.UI.Navigation.Urls;
namespace AuthServer.Host.Emailing
{
[Dependency(ReplaceServices = true)]
[ExposeServices(
typeof(IAccountEmailer),
typeof(AccountEmailer),
typeof(IAccountEmailVerifySender),
typeof(AccountEmailVerifySender))]
public class AccountEmailVerifySender : AccountEmailer, IAccountEmailVerifySender, ITransientDependency
{
public AccountEmailVerifySender(
IEmailSender emailSender,
ITemplateRenderer templateRenderer,
IStringLocalizer<AccountResource> stringLocalizer,
IAppUrlProvider appUrlProvider,
ICurrentTenant currentTenant)
: base(emailSender, templateRenderer, stringLocalizer, appUrlProvider, currentTenant)
{
}
public virtual async Task SendMailLoginVerifyLinkAsync(
IdentityUser user,
string code,
string appName,
string provider,
bool rememberMe = false,
string returnUrl = null,
string returnUrlHash = null)
{
Debug.Assert(CurrentTenant.Id == user.TenantId, "This method can only work for current tenant!");
// TODO: 需要生成快捷链接
//var url = await AppUrlProvider.GetUrlAsync(appName, AccountUrlNames.MailLoginVerify);
//var link = $"{url}?provider={provider}&rememberMe={rememberMe}&resetToken={UrlEncoder.Default.Encode(code)}";
//if (!returnUrl.IsNullOrEmpty())
//{
// link += "&returnUrl=" + NormalizeReturnUrl(returnUrl);
//}
//if (!returnUrlHash.IsNullOrEmpty())
//{
// link += "&returnUrlHash=" + returnUrlHash;
//}
var emailContent = await TemplateRenderer.RenderAsync(
AccountEmailTemplates.MailSecurityVerifyLink,
new { code = code, user = user.UserName }
);
await EmailSender.SendAsync(
user.Email,
StringLocalizer["MailSecurityVerify"],
emailContent
);
}
private string NormalizeReturnUrl(string returnUrl)
{
if (returnUrl.IsNullOrEmpty())
{
return returnUrl;
}
//Handling openid connect login
if (returnUrl.StartsWith("/connect/authorize/callback", StringComparison.OrdinalIgnoreCase))
{
if (returnUrl.Contains("?"))
{
var queryPart = returnUrl.Split('?')[1];
var queryParameters = queryPart.Split('&');
foreach (var queryParameter in queryParameters)
{
if (queryParameter.Contains("="))
{
var queryParam = queryParameter.Split('=');
if (queryParam[0] == "redirect_uri")
{
return HttpUtility.UrlDecode(queryParam[1]);
}
}
}
}
}
return returnUrl;
}
}
}

18
aspnet-core/services/account/AuthServer.Host/Emailing/IAccountEmailVerifySender.cs

@ -0,0 +1,18 @@
using System.Threading.Tasks;
using Volo.Abp.Account.Emailing;
using Volo.Abp.Identity;
namespace AuthServer.Host.Emailing
{
public interface IAccountEmailVerifySender : IAccountEmailer
{
Task SendMailLoginVerifyLinkAsync(
IdentityUser user,
string code,
string appName,
string provider,
bool rememberMe = false,
string returnUrl = null,
string returnUrlHash = null);
}
}

22
aspnet-core/services/account/AuthServer.Host/Emailing/Templates/AccountEmailTemplateDefinitionProvider.cs

@ -0,0 +1,22 @@
using Volo.Abp.Account.Localization;
using Volo.Abp.Emailing.Templates;
using Volo.Abp.Localization;
using Volo.Abp.TextTemplating;
namespace AuthServer.Host.Emailing.Templates
{
public class AccountEmailTemplateDefinitionProvider : TemplateDefinitionProvider
{
public override void Define(ITemplateDefinitionContext context)
{
context.Add(
new TemplateDefinition(
AccountEmailTemplates.MailSecurityVerifyLink,
displayName: LocalizableString.Create<AccountResource>($"TextTemplate:{AccountEmailTemplates.MailSecurityVerifyLink}"),
layout: StandardEmailTemplates.Layout,
localizationResource: typeof(AccountResource)
).WithVirtualFilePath("/Emailing/Templates/MailSecurityVerify.tpl", true)
);
}
}
}

10
aspnet-core/services/account/AuthServer.Host/Emailing/Templates/AccountEmailTemplates.cs

@ -0,0 +1,10 @@
namespace AuthServer.Host.Emailing.Templates
{
public static class AccountEmailTemplates
{
/// <summary>
/// 邮件安全验证
/// </summary>
public const string MailSecurityVerifyLink = "Abp.Account.MailSecurityVerifyLink";
}
}

5
aspnet-core/services/account/AuthServer.Host/Emailing/Templates/MailSecurityVerify.tpl

@ -0,0 +1,5 @@
<div style="position: absolute;">
<span>{{L "VerifyMyEmailAddress" model.user}}</span>
<p style="display:block; padding:0 50px; width: 150px; height:48px; line-height:48px; color:#cc0000; font-size:26px; background:#9c9797; font-weight:bold;">{{model.code}}</p>
<span>{{L "MailSecurityVerifyRemarks"}}</span>
</div>

18
aspnet-core/services/account/AuthServer.Host/Localization/Resources/en.json

@ -0,0 +1,18 @@
{
"culture": "en",
"texts": {
"TwoFactor": "Two factor authentication",
"SelectedProvider": "Select validation mode",
"SendVerifyCode": "Send verification code",
"VerifyCode": "Verification code",
"VerifyAuthenticatorCode": "Authentication code",
"RememberBrowser": "Remember me in the browser",
"TwoFactorAuthenticationInvaidUser": "Authentication failed. Your session is invalid. Please re login try again!",
"InvaidGenerateTwoFactorToken": "Verification code generation failed. Please contact your administrator!",
"TextTemplate:Abp.Account.MailSecurityVerifyLink": "Mail security validation template",
"MailSecurityVerify": "Mail security verification",
"VerifyMyEmailAddress": "Hello {0}<br/><p>Your email security verification code is as follows. Please enter the verification code to proceed to the next step.</p><p>If not operated by you, please ignore this email.</p>",
"MailSecurityVerifyRemarks": "<p>(If it is not in the form of a link, copy the address to the browser address bar for further access)</p><p>Thank you for your visit and have a good time!</p>",
"ClickToValidation": "Click link verification"
}
}

18
aspnet-core/services/account/AuthServer.Host/Localization/Resources/zh-Hans.json

@ -0,0 +1,18 @@
{
"culture": "zh-Hans",
"texts": {
"TwoFactor": "双因素身份验证",
"SelectedProvider": "选择验证方式",
"SendVerifyCode": "发送验证码",
"VerifyCode": "验证码",
"VerifyAuthenticatorCode": "验证身份代码",
"RememberBrowser": "在浏览器中记住我",
"TwoFactorAuthenticationInvaidUser": "认证失败,您的会话已失效,请程序登录!",
"InvaidGenerateTwoFactorToken": "验证码生成失败,请联系管理员!",
"TextTemplate:Abp.Account.MailSecurityVerifyLink": "邮件安全验证模板",
"MailSecurityVerify": "邮件安全验证",
"VerifyMyEmailAddress": "亲爱的 {0},您好<br/><p>您此次邮件安全验证码如下,请输入验证码进行下一步操作。</p><p>如非你本人操作,请忽略此邮件。</p>",
"MailSecurityVerifyRemarks": "此邮件为系统所发,请勿直接回复。",
"ClickToValidation": "点击进行验证"
}
}

21
aspnet-core/services/account/AuthServer.Host/Pages/Account/SendCode.cshtml

@ -0,0 +1,21 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model LINGYUN.Abp.Account.Web.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="SendCodeInput.SelectedProvider" label="@L["SelectedProvider"].Value" asp-items="@Model.Providers"></abp-select>
</div>
<abp-button type="submit" button-type="Primary" class="btn-block btn-lg mt-3">@L["SendVerifyCode"]</abp-button>
</form>
</div>
</div>

128
aspnet-core/services/account/AuthServer.Host/Pages/Account/SendCode.cshtml.cs

@ -0,0 +1,128 @@
using AuthServer.Host.Emailing;
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 SendCodeInput { 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()
{
SendCodeInput = 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 (SendCodeInput.SelectedProvider == "Authenticator")
{
// 用户通过邮件/短信链接进入授权页面
return RedirectToPage("VerifyAuthenticatorCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
// 生成验证码
var code = await UserManager.GenerateTwoFactorTokenAsync(user, SendCodeInput.SelectedProvider);
if (string.IsNullOrWhiteSpace(code))
{
Alerts.Warning(L["InvaidGenerateTwoFactorToken"]);
return Page();
}
if (SendCodeInput.SelectedProvider == "Email")
{
var appName = "MVC"; // TODO: 跟随Abp框架的意思变动
await AccountEmailVerifySender
.SendMailLoginVerifyLinkAsync(
user, code, appName,
SendCodeInput.SelectedProvider,
RememberMe, ReturnUrl, ReturnUrlHash);
}
else if (SendCodeInput.SelectedProvider == "Phone")
{
var phoneNumber = await UserManager.GetPhoneNumberAsync(user);
var templateCode = await SettingProvider.GetOrNullAsync(AccountSettingNames.SmsSigninTemplateCode);
Check.NotNullOrWhiteSpace(templateCode, nameof(AccountSettingNames.SmsSigninTemplateCode));
// 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 = SendCodeInput.SelectedProvider,
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = RememberMe
});
}
}
public class SendCodeInputModel
{
public string SelectedProvider { get; set; }
}
}

42
aspnet-core/services/account/AuthServer.Host/Pages/Account/TwoFactorSupportedLoginModel.cs

@ -0,0 +1,42 @@
using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Volo.Abp.Account.Web;
using Volo.Abp.Account.Web.Pages.Account;
using Volo.Abp.DependencyInjection;
namespace AuthServer.Host.Pages.Account
{
/// <summary>
/// 重写登录模型,实现双因素登录
/// </summary>
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LoginModel), typeof(IdentityServerSupportedLoginModel))]
public class TwoFactorSupportedLoginModel : IdentityServerSupportedLoginModel
{
public TwoFactorSupportedLoginModel(
IAuthenticationSchemeProvider schemeProvider,
IOptions<AbpAccountOptions> accountOptions,
IIdentityServerInteractionService interaction,
IClientStore clientStore,
IEventService identityServerEvents)
: base(schemeProvider, accountOptions, interaction, clientStore, identityServerEvents)
{
}
protected override Task<IActionResult> TwoFactorLoginResultAsync()
{
// 重定向双因素认证页面
return Task.FromResult<IActionResult>(RedirectToPage("SendCode", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash,
rememberMe = LoginInput.RememberMe
}));
}
}
}

4
aspnet-core/services/account/AuthServer.Host/Pages/Account/UseRecoveryCode.cshtml

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

16
aspnet-core/services/account/AuthServer.Host/Pages/Account/UseRecoveryCode.cshtml.cs

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

23
aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyAuthenticatorCode.cshtml

@ -0,0 +1,23 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@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">
<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>
</form>
</div>
</div>

61
aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyAuthenticatorCode.cshtml.cs

@ -0,0 +1,61 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Volo.Abp.Account.Web.Pages.Account;
namespace LINGYUN.Abp.Account.Web.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 virtual async Task<IActionResult> OnPostAsync()
{
var result = await SignInManager.TwoFactorAuthenticatorSignInAsync(Input.VerifyCode, RememberMe, RememberBrowser);
if (result.Succeeded)
{
return RedirectSafely(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; }
}
}

24
aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyCode.cshtml

@ -0,0 +1,24 @@
@page
@inject IHtmlLocalizer<AccountResource> L
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@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">
<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>
<abp-button type="submit" button-type="Primary" class="btn-block btn-lg mt-3">@L["VerifyAuthenticatorCode"]</abp-button>
</form>
</div>
</div>

92
aspnet-core/services/account/AuthServer.Host/Pages/Account/VerifyCode.cshtml.cs

@ -0,0 +1,92 @@
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 LINGYUN.Abp.Account.Web.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 virtual async 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 RedirectSafely(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; }
}
}
Loading…
Cancel
Save