dev:验证码相关
parent
62a5570403
commit
8b830100a0
|
|
@ -3,6 +3,7 @@ package com.zcloud.basic.info.command;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.zcloud.basic.info.constant.RedisConstant;
|
||||
import com.zcloud.basic.info.domain.enums.UserEmploymentFlagEnum;
|
||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||
import com.zcloud.basic.info.dto.AppUserLogOutCmd;
|
||||
|
|
@ -36,7 +37,7 @@ public class UserRemoveExe {
|
|||
@DubboReference(check = false)
|
||||
private UserFacade userFacade;
|
||||
// @Autowired
|
||||
// private ZcloudRedisUtil zcloudRedisUtil;
|
||||
private ZcloudRedisUtil zcloudRedisUtil;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
|
|
@ -53,12 +54,14 @@ public class UserRemoveExe {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean executeLogOut(AppUserLogOutCmd cmd) {
|
||||
|
||||
UserDO userDO = userRepository.getById(cmd.getId());
|
||||
|
||||
// 获取redis验证码
|
||||
// Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + cmd.getPhone());
|
||||
// if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
||||
// throw new BizException("验证码已过期或错误");
|
||||
// }
|
||||
// zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + cmd.getPhone());
|
||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
||||
throw new BizException("验证码已过期或错误");
|
||||
}
|
||||
zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
|
||||
try {
|
||||
// 删除底座用户信息
|
||||
|
|
|
|||
|
|
@ -164,16 +164,6 @@ public class UserUpdateExe {
|
|||
UserE userE = new UserE();
|
||||
userE.checkPassword(cmd.getNewPassword(), cmd.getConfirmPassword());
|
||||
|
||||
UserDO userDO = userRepository.getInfoById(cmd.getId());
|
||||
// todo 验证码
|
||||
|
||||
// 获取redis验证码
|
||||
// Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + userDO.getPhone());
|
||||
// if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
||||
// throw new BizException("验证码已过期或错误");
|
||||
// }
|
||||
// zcloudRedisUtil.del(RedisConstant.PHONE_CODE_KEY + cmd.getPhone());
|
||||
|
||||
BeanUtils.copyProperties(cmd, userE);
|
||||
userE.encryptionPassword();
|
||||
userGateway.updatePassword(userE);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ public class AppUserLogOutCmd implements Serializable {
|
|||
@NotNull(message = "用户id不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "验证码", name = "phoneCode", required = true)
|
||||
@NotEmpty(message = "验证码不能为空")
|
||||
private String phoneCode;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue