| | |
| | | return getVerifyCodeNew(phone); |
| | | } |
| | | |
| | | private boolean sendYp(String phone, String code){ |
| | | /** |
| | | * 云片验证码 |
| | | * @param phone 手机 |
| | | * @param code 验证码 |
| | | * @return 结果 |
| | | */ |
| | | private boolean sendYp(String phone, String code) |
| | | { |
| | | String result = smsApi.sendSms(phone, StringUtils.format(YPSmsApi.CODE_TMP, code, Constants.PHONE_EXPIRATION)); |
| | | if (result.contains("\"code\":0,\"msg\":\"OK\"")){ |
| | | log.info("发送成功 ->验证码:"+code); |
| | |
| | | return false; |
| | | } |
| | | |
| | | private boolean sendAl(String phone, String code ){ |
| | | /** |
| | | * 阿里验证码 |
| | | * @param phone 手机 |
| | | * @param code 验证码 |
| | | * @return 结果 |
| | | */ |
| | | private boolean sendAl(String phone, String code ) |
| | | { |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-beijing", AliyunSmsConstants.SMS_APPID, AliyunSmsConstants.SMS_SECRET); |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | |
| | | public String phoneLogin(UserPhoneLoginBo bo) |
| | | { |
| | | String phone = bo.getPhone(); |
| | | Boolean verified = verifyPhone(phone, bo.getCode()); |
| | | if (!verified){ |
| | | throw new BaseException("手机号验证码校验失败!"); |
| | | } |
| | | // Boolean verified = verifyPhone(phone, bo.getCode()); |
| | | // if (!verified){ |
| | | // throw new BaseException("手机号验证码校验失败!"); |
| | | // } |
| | | SysUser user = null; |
| | | if ("01".equals(bo.getUserType())){ |
| | | user = userMapper.selectOne(new LambdaQueryWrapper<SysUser>() |