|
|
@@ -52,6 +52,7 @@ public class VerificationCodeController {
|
|
|
public BaseDTO checkVeriCode(@RequestBody Map<String, Object> map, HttpServletRequest request) {
|
|
|
// 获取手机号码
|
|
|
String mobile = (String) map.get("mobile");
|
|
|
+ String password = (String) map.get("password");
|
|
|
String verificationCode = (String) map.get("verificationCode");
|
|
|
// 如果已经注册就报错
|
|
|
Passport tmp = passportDAO.findByMobile(mobile);
|
|
|
@@ -63,7 +64,12 @@ public class VerificationCodeController {
|
|
|
long now = System.currentTimeMillis();
|
|
|
long veriCodeDeadline = now + 60 * 1000 * 5;
|
|
|
if (verificationCode.equals(veriCode) && veriCodeDeadline > tmp.getVeriCodeDeadline()) {
|
|
|
- passportDAO.updateState(mobile, 1, now);
|
|
|
+ if (password != null && !"".equals(password)) {
|
|
|
+ passportDAO.updateStateAndPassword(mobile, 1, password, now);
|
|
|
+ } else {
|
|
|
+ passportDAO.updateState(mobile, 1, now);
|
|
|
+ }
|
|
|
+ tmp.setState(1);
|
|
|
HttpSession session = request.getSession();
|
|
|
session.setAttribute("PASSPORT", tmp);
|
|
|
|