Browse Source

发送登录短信验证码

zouxuan 1 năm trước cách đây
mục cha
commit
61223a3e43

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import java.util.List;
 
+import com.ym.mec.auth.api.enums.YesOrNoEnum;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -40,10 +41,13 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 	@Override
 	public boolean sendValidCode(String mobile) {
 		SysUser sysUser = sysUserFeignService.queryUserByMobile(mobile);
-		Integer userId = null;
-		if (sysUser != null) {
-			userId = sysUser.getId();
+		if (sysUser == null) {
+			throw new BizException("账号不存在!");
 		}
+		if(sysUser.getLockFlag() == 9 || 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) {