验证码测试过滤
parent
eac70af369
commit
d359f63aa3
|
|
@ -27,6 +27,7 @@ import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
|||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
|
@ -118,7 +119,9 @@ public class UserAddExe {
|
|||
userE.checkPassword(cmd.getNewPassword(), cmd.getConfirmPassword());
|
||||
|
||||
// 获取redis验证码
|
||||
if(!"123".equals(cmd.getPhoneCode())){
|
||||
if(!"dev".equals(codeConfig.getProfile())){
|
||||
|
||||
|
||||
Object phoneCodeObj = zcloudRedisUtil.get(RedisConstant.PHONE_CODE_KEY + cmd.getPhone());
|
||||
if(phoneCodeObj == null || !phoneCodeObj.toString().equals(cmd.getPhoneCode())){
|
||||
throw new BizException("验证码已过期或错误");
|
||||
|
|
|
|||
|
|
@ -10,4 +10,5 @@ import org.springframework.stereotype.Component;
|
|||
public class CodeConfig {
|
||||
|
||||
private String message="MS000087";
|
||||
private String profile="prod";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue