From 7bb7d7803ed2486158d9dac18f99f245e0dc10bf Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Wed, 17 Jan 2018 15:50:57 +0800 Subject: [PATCH] fix --- .../signin/core/impls/SignInAccountServiceImpl.java | 7 ++++--- src/main/resources/i18n/msg_en.properties | 9 +++++++-- src/main/resources/i18n/msg_zh.properties | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index 042a1149d..d7363a34a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -18,6 +18,7 @@ import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.RequestEnvironment; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; +import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.utils.PasswordUtils; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -138,7 +139,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati validLoginInfo(loginInfo, account); JSONObject client = clientManager.getClientInfoIgnoreInvalid(account.getIntValue("client_id")); if (client != null && !client.getBooleanValue("is_valid")) { - throw new BadRequestException("用户名或密码不正确"); + throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); } validLoginInfo(loginInfo, account); publisher.publishEvent(new ManagerLoginEvent(this, account.getString("manager_id"), RequestEnvironment.getClientIp(), "PASSWORD")); @@ -147,12 +148,12 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati private void validLoginInfo(LoginInfo loginInfo, JSONObject account) { if (account == null) { - throw new BadRequestException("用户名或密码不正确"); + throw new BadRequestException(LocaleSupport.localeMessage("login.error.password")); } String salt = account.getString("salt"); String pwdHash = loginInfo.getPasswordHashed(salt); if (!StringUtils.equals(pwdHash, account.getString("password_hash"))) { - throw new BadRequestException("用户名或密码不正确"); + throw new BadRequestException(LocaleSupport.localeMessage("login.error.password")); } } diff --git a/src/main/resources/i18n/msg_en.properties b/src/main/resources/i18n/msg_en.properties index 1af9aaee8..4eed85d8e 100644 --- a/src/main/resources/i18n/msg_en.properties +++ b/src/main/resources/i18n/msg_en.properties @@ -52,7 +52,7 @@ error.permission.not_login=Please sign in first error.permission.login_again=Your login has expired. Please sign in again. error.permission.nopermission=You have no permission to access this resource. error.permission.not_manager_login=Use manager account and sign in. -s + error.settlement.season_invalid=Season of next rate cycle not started. Unable to generate new rate automatically error.partner.valid.dumplicate_client_moniker=Partner code exists @@ -76,6 +76,9 @@ error.register.valid.dumplicate_email=The email address has been registered,plea error.payment.xplan.enable=Activity not started yet. Keep attention about us. error.payment.xplan.not-auto-join=Self-join not allowed yet. Contact our service please. +error.login.password=User name or password error. + + todo.settlement.date_setting=Settle Dates configured are running out. Config new Settle Dates todo.rate.expire_warning=Some clients' rate are expiring soon or expired. Please fix it as soon as possible. todo.client.approve=Some clients are waiting for compliance. @@ -95,4 +98,6 @@ app.label.pay=Pay app.label.remark=Remark app.label.creating-order=... app.label.close=Close -app.label.coupons=Available Coupons \ No newline at end of file +app.label.coupons=Available Coupons + + diff --git a/src/main/resources/i18n/msg_zh.properties b/src/main/resources/i18n/msg_zh.properties index 27da7006a..e91b8532e 100644 --- a/src/main/resources/i18n/msg_zh.properties +++ b/src/main/resources/i18n/msg_zh.properties @@ -73,6 +73,7 @@ error.payment.customer_cheat=交易次数过频,请明日再试 error.payment.xplan.enable=活动暂未开通,敬请期待 error.payment.xplan.not-auto-join=暂不允许自主申请,详请联系我们客服 +error.login.password=用户名或密码错误 todo.settlement.date_setting=已配置清算日即将到期,请配置新的清算日 todo.rate.expire_warning=有商户费率即将到期或已过期,请尽快处理