|
|
@@ -71,15 +71,16 @@ public class ContactUsServiceImpl extends ServiceImpl<IContactUsMapper, ContactU
|
|
|
|
|
|
User user = userService.getByUserName(contactUs.getEmail());
|
|
|
contactUs.setCountry(IPUtils.getCountry(contactUs.getIpAddress()));
|
|
|
+ redisUtil.set(redisKey,"1",60 *5);
|
|
|
if(user !=null){
|
|
|
- mailTemplateService.sendContactUs2(contactUs.getEmail());
|
|
|
+ mailTemplateService.sendContactUs2(contactUs.getEmail(),13);
|
|
|
this.save(contactUs);
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
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);
|
|
|
@@ -88,7 +89,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);
|
|
|
}
|
|
|
@@ -96,7 +96,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();
|
|
|
@@ -121,9 +120,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;
|
|
|
}
|