Browse Source

发送登录短信验证码

zouxuan 1 year ago
parent
commit
dd855034b9

+ 6 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SmsCodeServiceImpl.java

@@ -41,13 +41,13 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 	@Override
 	public boolean sendValidCode(String mobile) {
 		SysUser sysUser = sysUserFeignService.queryUserByMobile(mobile);
-		if (sysUser == null) {
-			throw new BizException("账号不存在!");
+		Integer userId = null;
+		if (sysUser != null) {
+			if(sysUser.getLockFlag() == 9 || sysUser.getLockFlag() == 1 || sysUser.getDelFlag() == YesOrNoEnum.YES) {
+				throw new BizException("账号已冻结,请联系管理员");
+			}
+			userId = sysUser.getId();
 		}
-		if(sysUser.getLockFlag() == 9 || sysUser.getLockFlag() == 1 || sysUser.getDelFlag() == YesOrNoEnum.YES) {
-			throw new BizException("账号已冻结,请联系管理员");
-		}
-		Integer userId = sysUser.getId();
 		SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.SMS_MAX_TIMES);
 		int times = 3;
 		if (sysConfig != null) {