|
|
@ -1,8 +1,10 @@ |
|
|
|
package com.kelp.business; |
|
|
|
|
|
|
|
|
|
|
|
import com.google.code.kaptcha.Constants; |
|
|
|
import com.kelp.business.dao.BuyDao; |
|
|
|
import com.kelp.business.entity.Buy; |
|
|
|
import com.kelp.common.config.RedisBean; |
|
|
|
import com.kelp.common.utils.IdWorker; |
|
|
|
import com.kelp.crm.entity.ECustomer; |
|
|
|
import com.kelp.crm.service.ECustomerService; |
|
|
@ -28,6 +30,8 @@ public class BuyController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ECustomerService customerService; |
|
|
|
@Autowired |
|
|
|
protected RedisBean redisBean; |
|
|
|
|
|
|
|
@PostMapping(path = {prefix + "/{type}"}) |
|
|
|
public ModelMap index(@PathVariable("type") String type, Buy buy) { |
|
|
@ -57,6 +61,18 @@ public class BuyController { |
|
|
|
modelMap.put(RESULT, false); |
|
|
|
return modelMap; |
|
|
|
} |
|
|
|
|
|
|
|
String timestamp = buy.getTimestamp(); |
|
|
|
String captcha = buy.getCaptcha(); |
|
|
|
if(!StringUtil.isEmpty(timestamp)){ |
|
|
|
String captcha_ = redisBean.hget(Constants.KAPTCHA_SESSION_KEY, timestamp); |
|
|
|
if(captcha_ == null || !captcha_.equals(captcha)) { |
|
|
|
modelMap.put(RESULT, false); |
|
|
|
modelMap.put(MESSAGE, "验证码不正确或已过期!"); |
|
|
|
return modelMap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
eCustomer.setTelephone(telephone); |
|
|
|
eCustomer.setEffctiveTime(System.currentTimeMillis()); |
|
|
|
eCustomer.setExpiredTime(System.currentTimeMillis()); |
|
|
|