Browse Source

改变验证码失败的错误提示.

pull/627/head
cKey 3 years ago
parent
commit
02dee95647
  1. 8
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs
  2. 3
      aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/Localization/Resources/en.json
  3. 3
      aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json
  4. 2
      aspnet-core/services/LY.MicroService.identityServer/Pages/Account/VerifyCode.cshtml

8
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs

@ -147,7 +147,7 @@ namespace LINGYUN.Abp.Account
if (securityTokenCacheItem == null) if (securityTokenCacheItem == null)
{ {
// 验证码过期 // 验证码过期
throw new UserFriendlyException(L["InvalidSmsVerifyCode"]); throw new UserFriendlyException(L["InvalidVerifyCode"]);
} }
// 验证码是否有效 // 验证码是否有效
@ -188,7 +188,7 @@ namespace LINGYUN.Abp.Account
} }
} }
// 验证码无效 // 验证码无效
throw new UserFriendlyException(L["InvalidSmsVerifyCode"]); throw new UserFriendlyException(L["InvalidVerifyCode"]);
} }
public virtual async Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input) public virtual async Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input)
@ -246,7 +246,7 @@ namespace LINGYUN.Abp.Account
var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey);
if (securityTokenCacheItem == null) if (securityTokenCacheItem == null)
{ {
throw new UserFriendlyException(L["InvalidSmsVerifyCode"]); throw new UserFriendlyException(L["InvalidVerifyCode"]);
} }
await IdentityOptions.SetAsync(); await IdentityOptions.SetAsync();
// 传递 isConfirmed 用户必须是已确认过手机号的 // 传递 isConfirmed 用户必须是已确认过手机号的
@ -260,7 +260,7 @@ namespace LINGYUN.Abp.Account
if (!await UserManager.VerifyTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider, input.Code)) if (!await UserManager.VerifyTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider, input.Code))
{ {
// 验证码无效 // 验证码无效
throw new UserFriendlyException(L["InvalidSmsVerifyCode"]); throw new UserFriendlyException(L["InvalidVerifyCode"]);
} }
// 生成真正的重置密码Token // 生成真正的重置密码Token
var resetPwdToken = await UserManager.GeneratePasswordResetTokenAsync(user); var resetPwdToken = await UserManager.GeneratePasswordResetTokenAsync(user);

3
aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/Localization/Resources/en.json

@ -6,7 +6,7 @@
"SendRepeatSmsVerifyCode": "Phone verification code cannot be sent repeatedly within {0} minutes!", "SendRepeatSmsVerifyCode": "Phone verification code cannot be sent repeatedly within {0} minutes!",
"DuplicatePhoneNumber": "The phone number already exists!", "DuplicatePhoneNumber": "The phone number already exists!",
"PhoneNumberNotRegisterd": "The registered mobile phone number is not registered!", "PhoneNumberNotRegisterd": "The registered mobile phone number is not registered!",
"InvalidSmsVerifyCode": "The phone verification code is invalid or expired!", "InvalidVerifyCode": "The verification code is invalid or expired!",
"RequiredEmailAddress": "Email address required", "RequiredEmailAddress": "Email address required",
"InvalidPhoneNumber": "Invalid phone number", "InvalidPhoneNumber": "Invalid phone number",
"DuplicateWeChat": "The wechat has been registered!", "DuplicateWeChat": "The wechat has been registered!",
@ -19,6 +19,7 @@
"TwoFactor:Authenticator": "Authenticator", "TwoFactor:Authenticator": "Authenticator",
"SelectedProvider": "Select validation mode", "SelectedProvider": "Select validation mode",
"SendVerifyCode": "Send verification code", "SendVerifyCode": "Send verification code",
"ReSendVerifyCode": "Resend the verification code",
"VerifyCode": "Verification code", "VerifyCode": "Verification code",
"VerifyAuthenticatorCode": "Authentication code", "VerifyAuthenticatorCode": "Authentication code",
"RememberBrowser": "Remember me in the browser", "RememberBrowser": "Remember me in the browser",

3
aspnet-core/modules/account/LINGYUN.Abp.Account.Domain.Shared/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json

@ -6,7 +6,7 @@
"SendRepeatSmsVerifyCode": "手机验证码不能在 {0} 分钟内重复发送!", "SendRepeatSmsVerifyCode": "手机验证码不能在 {0} 分钟内重复发送!",
"DuplicatePhoneNumber": "手机号已经存在!", "DuplicatePhoneNumber": "手机号已经存在!",
"PhoneNumberNotRegisterd": "手机号码未注册!", "PhoneNumberNotRegisterd": "手机号码未注册!",
"InvalidSmsVerifyCode": "手机验证码无效或已经过期!", "InvalidVerifyCode": "验证码无效或已经过期!",
"RequiredEmailAddress": "邮件地址必须输入", "RequiredEmailAddress": "邮件地址必须输入",
"InvalidPhoneNumber": "手机号无效", "InvalidPhoneNumber": "手机号无效",
"DuplicateWeChat": "微信号已经注册过!", "DuplicateWeChat": "微信号已经注册过!",
@ -19,6 +19,7 @@
"TwoFactor:Authenticator": "验证码验证", "TwoFactor:Authenticator": "验证码验证",
"SelectedProvider": "选择验证方式", "SelectedProvider": "选择验证方式",
"SendVerifyCode": "发送验证码", "SendVerifyCode": "发送验证码",
"ReSendVerifyCode": "重新发送验证码",
"VerifyCode": "验证码", "VerifyCode": "验证码",
"VerifyAuthenticatorCode": "验证身份代码", "VerifyAuthenticatorCode": "验证身份代码",
"RememberBrowser": "在浏览器中记住我", "RememberBrowser": "在浏览器中记住我",

2
aspnet-core/services/LY.MicroService.identityServer/Pages/Account/VerifyCode.cshtml

@ -22,7 +22,7 @@
<abp-button type="submit" button-type="Primary" class="mt-2 mb-3">@L["VerifyAuthenticatorCode"]</abp-button> <abp-button type="submit" button-type="Primary" class="mt-2 mb-3">@L["VerifyAuthenticatorCode"]</abp-button>
</div> </div>
<a asp-page="./SendCode" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})"> <a asp-page="./SendCode" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})">
<i class="fa fa-long-arrow-left"></i> @L["SendVerifyCode"] <i class="fa fa-long-arrow-left"></i> @L["ReSendVerifyCode"]
</a> </a>
</form> </form>
</div> </div>

Loading…
Cancel
Save