无关风月
2024-11-15 06dad2095dbe4c465025e5bc6e0220521636e2c2
xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java
@@ -6,6 +6,7 @@
import com.xinquan.auth.form.AppLoginBody;
import com.xinquan.auth.form.AppRegisterBody;
import com.xinquan.auth.form.VerifyResultVO;
import com.xinquan.auth.util.HWSendSms;
import com.xinquan.auth.util.HuaWeiSMSUtil;
import com.xinquan.common.core.constant.CacheConstants;
import com.xinquan.common.core.constant.Constants;
@@ -114,6 +115,9 @@
        
        LoginUser userInfo = userResult.getData();
        SysUser user = userResult.getData().getSysUser();
        if (user.getStatus().equals("1")){
            throw new ServiceException("对不起,您的账号:" + username + " 已被冻结,请联系管理员");
        }
        if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
        {
            recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
@@ -280,7 +284,10 @@
            default:
                return "";
        }
    }
    @Autowired
    private HWSendSms hwSendSms;
    /**
     * 发送验证码
     *
@@ -296,8 +303,10 @@
                    TimeUnit.MINUTES);
            log.info("发送验证码成功,手机号:{} 验证码:{}", cellPhone, code);
            // TODO 修改sender参数及templateId
             HuaWeiSMSUtil.sendSms("[\"" + code + "\"]", cellPhone, "8824110423893",
                     "767ad27dce184a32a4b4863517fbd301\n");
//             HuaWeiSMSUtil.sendSms("[\"" + code + "\"]", cellPhone, "8824110423893",
//                     "767ad27dce184a32a4b4863517fbd301");
            hwSendSms.sendSms(code, cellPhone);
        } catch (Exception e) {
            log.error("发送短信失败", e);
            throw new ServiceException("验证码发送失败");