|
|
@@ -62,10 +62,6 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
|| StringUtils.isBlank(contactUs.getEmail()) || StringUtils.isBlank(contactUs.getCompany())){
|
|
|
throw new BusinessException(ResultCode.PARAM_MISS);
|
|
|
}
|
|
|
- String redisKey = String.format(RedisKeyUtil.CONTACT_US_KEY,contactUs.getEmail());
|
|
|
- if(redisUtil.hasKey(redisKey)){
|
|
|
- throw new BusinessException(ResultCode.email_submit);
|
|
|
- }
|
|
|
String uuid = UUID.randomUUID().toString().replace("-", "");
|
|
|
String redisKey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,uuid);
|
|
|
|
|
|
@@ -80,7 +76,6 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
String callBackUrl = ucenterConfig.getContactUsCallBackUrl() + uuid;
|
|
|
Boolean b = mailTemplateService.sendContactUs(contactUs.getEmail(),callBackUrl);
|
|
|
if(b){
|
|
|
- redisUtil.set(redisKey, uuid,ucenterConfig.getEmailExTime());
|
|
|
redisUtil.set(redisKey2, JSONObject.toJSONString(contactUs),ucenterConfig.getEmailExTime());
|
|
|
}
|
|
|
this.save(contactUs);
|
|
|
@@ -89,7 +84,6 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
@Override
|
|
|
public LoginVo callBack(String uuid) {
|
|
|
String rediskey = String.format(RedisKeyUtil.CONTACT_US_KEY,uuid);
|
|
|
- String rediskey2 = null;
|
|
|
if(!redisUtil.hasKey(rediskey)){
|
|
|
throw new BusinessException(ResultCode.url_exprix);
|
|
|
}
|
|
|
@@ -97,7 +91,6 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
try {
|
|
|
if(redisUtil.hasKey(rediskey) ){
|
|
|
ContactUs contactUs = JSONObject.parseObject( redisUtil.get(rediskey),ContactUs.class);
|
|
|
- rediskey2 = String.format(RedisKeyUtil.CONTACT_US_KEY,contactUs.getEmail());
|
|
|
User userEntity = userService.getByUserName(contactUs.getEmail());
|
|
|
if(userEntity == null){
|
|
|
userEntity = new User();
|
|
|
@@ -122,9 +115,6 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
log.info("contact-us-callback-error:{}",e);
|
|
|
}finally {
|
|
|
redisUtil.del(rediskey);
|
|
|
- if(rediskey2 != null){
|
|
|
- redisUtil.del(rediskey2);
|
|
|
- }
|
|
|
}
|
|
|
return null;
|
|
|
}
|