diff --git a/pom.xml b/pom.xml index 1ea51bcdb..77ff80cd6 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.62 + 1.2.63 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index dcdd976b7..f810a4146 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -38,6 +38,8 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.ibatis.annotations.Param; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.cache.annotation.Cacheable; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; @@ -52,6 +54,7 @@ import java.util.stream.Collectors; @Service public class ManageAppServiceImp implements ManageAppService { + private Logger logger = LoggerFactory.getLogger(getClass()); @Resource private ManageDeviceSupport manageDeviceSupport; @@ -470,6 +473,7 @@ public class ManageAppServiceImp implements ManageAppService { throw new BadRequestException("Captcha has been sent.Please check your email or try again in 5 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); Context ctx = new Context(); JSONObject manager = managerMapper.findById(device.getString("manager_id")); ctx.setVariable("account",manager); @@ -480,7 +484,7 @@ public class ManageAppServiceImp implements ManageAppService { mailService.sendEmail("Your account is in the process of binding a mailbox", email.getString("contact_email"), "", content); } catch (Exception e) { - throw new EmailException("Email Sending Failed", e); +// throw new EmailException("Email Sending Failed", e); } }); stringRedisTemplate.boundValueOps(getUpdateManageEmailKey(codeKey)).set(codeKeyValue+"&"+email.getString("contact_email"), 5, TimeUnit.MINUTES); @@ -512,6 +516,7 @@ public class ManageAppServiceImp implements ManageAppService { throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 5 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); String nationCode = phone.getString("nation_code"); String phoneNumber = phone.getString("contact_phone"); ArrayList param = new ArrayList<>(); @@ -522,8 +527,8 @@ public class ManageAppServiceImp implements ManageAppService { try { smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, BIND_PHONE_TEMPLID, param, "RoyalPay", "", ""); } catch (Exception e) { - e.printStackTrace(); - throw new ServerErrorException("Phone number is wrong.Please try again."); +// e.printStackTrace(); +// throw new ServerErrorException("Phone number is wrong.Please try again."); } stringRedisTemplate.boundValueOps(getUpdateManagePhoneKey(codeKey)).set(codeKeyValue+"&"+nationCode+"&"+phoneNumber, Long.parseLong(expireMin), TimeUnit.MINUTES); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index bd7a62c6f..162802f49 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -2098,6 +2098,7 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Captcha has been sent.Please check your email or try again in 5 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); Context ctx = new Context(); JSONObject account = clientAccountMapper.findById(device.getString("account_id")); ctx.setVariable("account", account); @@ -2140,6 +2141,7 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); String nationCode = phone.getString("nation_code").contains("+")?phone.getString("nation_code").substring(1):phone.getString("nation_code"); String phoneNumber = phone.getString("contact_phone"); ArrayList param = new ArrayList<>(); @@ -2150,8 +2152,8 @@ public class RetailAppServiceImp implements RetailAppService { try { smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, BIND_PHONE_TEMPLID, param, "RoyalPay", "", ""); } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new BadRequestException("Phone number is wrong.Please try again."); +// logger.error(e.getMessage(), e); +// throw new BadRequestException("Phone number is wrong.Please try again."); } stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Long.parseLong(expireMin), TimeUnit.MINUTES); } @@ -2174,8 +2176,8 @@ public class RetailAppServiceImp implements RetailAppService { try { smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, BIND_PHONE_TEMPLID, param, "RoyalPay", "", ""); } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new BadRequestException("Phone number is wrong.Please try again."); +// logger.error(e.getMessage(), e); +// throw new BadRequestException("Phone number is wrong.Please try again."); } stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Long.parseLong(expireMin), TimeUnit.MINUTES); } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 53c1eb8f5..0184d8e8c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -170,6 +170,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { param.add(registerClientCode); String expireMin = "3"; param.add(expireMin); + logger.debug("send sms code : {} ", registerClientCode); try { if(request.getLocales().nextElement().equals(Locale.CHINESE)|| request.getLocales().nextElement().equals(Locale.SIMPLIFIED_CHINESE)){ smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); @@ -177,8 +178,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID_ENGLISH, param, "RoyalPay", "", ""); } } catch (Exception e) { - e.printStackTrace(); - throw new ServerErrorException("Phone number is wrong Please try again"); +// e.printStackTrace(); +// throw new ServerErrorException("Phone number is wrong Please try again"); } stringRedisTemplate.boundValueOps(getRegisterClientRedisKey(phoneNumber)).set(registerClientCode, Long.parseLong(expireMin), TimeUnit.MINUTES); return registerClientCode; @@ -880,8 +881,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID_ENGLISH, param, "RoyalPay", "", ""); } } catch (Exception e) { - e.printStackTrace(); - throw new ServerErrorException("Phone number is wrong Please try again"); +// e.printStackTrace(); +// throw new ServerErrorException("Phone number is wrong Please try again"); } stringRedisTemplate.boundValueOps(getLoginClientRedisKey(phoneNumber)).set(registerClientCode, Long.parseLong(expireMin), TimeUnit.MINUTES); }