Merge remote-tracking branch 'origin/clientApply' into clientApply

master
yuan 7 years ago
commit c7a80a9b26

@ -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);

@ -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<String> to = new HashSet<>();

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

@ -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();

@ -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");
}

Loading…
Cancel
Save