|
|
@@ -2,6 +2,7 @@ package com.finikes.oc.base.controller;
|
|
|
|
|
|
import com.finikes.oc.BaseDTO;
|
|
|
import com.finikes.oc.BizException;
|
|
|
+import com.finikes.oc.Passports;
|
|
|
import com.finikes.oc.base.dao.PassportDAO;
|
|
|
import com.finikes.oc.base.dto.RegisterResponseDTO;
|
|
|
import com.finikes.oc.base.entity.Passport;
|
|
|
@@ -9,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpSession;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RequestMapping("/verificationCode")
|
|
|
@@ -42,7 +45,7 @@ public class VerificationCodeController {
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/", method = RequestMethod.POST)
|
|
|
- public BaseDTO checkVeriCode(@RequestBody Map<String, Object> map) {
|
|
|
+ public BaseDTO checkVeriCode(@RequestBody Map<String, Object> map, HttpServletRequest request) {
|
|
|
// 获取手机号码
|
|
|
String mobile = (String) map.get("mobile");
|
|
|
String verificationCode = (String) map.get("verificationCode");
|
|
|
@@ -57,6 +60,10 @@ public class VerificationCodeController {
|
|
|
long veriCodeDeadline = now + 60 * 1000 * 5;
|
|
|
if (verificationCode.equals(veriCode) && veriCodeDeadline <= tmp.getVeriCodeDeadline()) {
|
|
|
passportDAO.updateState(mobile, 1, now);
|
|
|
+ HttpSession session = request.getSession();
|
|
|
+ session.setAttribute("PASSPORT", tmp);
|
|
|
+
|
|
|
+ System.out.println(Passports.getPassport(request) + " =============");
|
|
|
return new BaseDTO();
|
|
|
} else {
|
|
|
return new BaseDTO(new BizException("103", "验证码错误或失效"));
|