From df1e735effd2c37cdb71db96fd8fd9997c195d3e Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Fri, 25 May 2018 17:05:40 +0800 Subject: [PATCH] update --- .../manage/application/core/SimpleClientApplyService.java | 2 +- .../application/core/impls/SimpleClientApplyServiceImpl.java | 4 ++-- .../manage/application/web/SimpleClientApplyController.java | 5 +++-- src/main/resources/templates/mail/verify_mail.html | 3 ++- .../core/impls/SimpleClientApplyServiceImplTest.java | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java index d2725d1f4..458dce958 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java @@ -17,7 +17,7 @@ public interface SimpleClientApplyService { void deleteRegisterProcessKey(String codeKey); - void sendVerifyEmail(String address, int client_id); + void sendVerifyEmail(String address, int client_id,String username); String checkOrGenerateVerifyMailKey(String address, String codeKey); 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 304c72d51..a0a5279b2 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 @@ -151,14 +151,14 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } @Override - public void sendVerifyEmail(String address, int client_id) { + public void sendVerifyEmail(String address, int client_id,String username) { JSONObject client = clientManager.getClientInfo(client_id); if (client == null) { throw new BadRequestException("Merchant not found"); } String key = checkOrGenerateVerifyMailKey(address, null); Context ctx = new Context(); - ctx.setVariable("url", PlatformEnvironment.getEnv().concatUrl("/register/account/mail/" + address + "/verify/" + key + "/jump")); + ctx.setVariable("url", PlatformEnvironment.getEnv().concatUrl("/register/account/mail/" + address + "/verify/" + key + "/jump?username="+username)); final String content = thymeleaf.process("mail/register_application", ctx); SendMail sendMail = new SendMail(); Set to = new HashSet<>(); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index 56d445f69..7cdecc236 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -46,11 +46,12 @@ public class SimpleClientApplyController { } @RequestMapping(value = "/account/mail/{address}/verify/{codeKey}/jump", method = RequestMethod.GET) - public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address) { + public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address,@RequestParam String username) { simpleClientApplyService.checkOrGenerateVerifyMailKey(address, codeKey); - ModelAndView view = new ModelAndView("mail/register_application"); + ModelAndView view = new ModelAndView("mail/verify_mail"); view.addObject("codeKey", codeKey); view.addObject("address", address); + view.addObject("username",username); return view; } diff --git a/src/main/resources/templates/mail/verify_mail.html b/src/main/resources/templates/mail/verify_mail.html index 421c98c45..e68034a6d 100644 --- a/src/main/resources/templates/mail/verify_mail.html +++ b/src/main/resources/templates/mail/verify_mail.html @@ -83,7 +83,8 @@ $(document).ready(function () { window.address = /*[[${address}]]*/''; window.codeKey = /*[[${codeKey}]]*/''; - + window.username = /*[[${username}]]*/''; + $('#userName').val(window.username); $('input').keypress(function (evt) { if (evt.keyCode == 13) { $('#login-btn').click(); diff --git a/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java b/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java index e8aca7c16..255fad75f 100644 --- a/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java @@ -38,7 +38,7 @@ public class SimpleClientApplyServiceImplTest { @Test public void sendVerifyEmail() { - simpleClientApplyService.sendVerifyEmail("kira.wang@royalpay.com.au", 9); + simpleClientApplyService.sendVerifyEmail("kira.wang@royalpay.com.au", 9,"kiratest"); }