| | |
| | | |
| | | private static QYTConfig qytConfig = SpringContextsUtil.getBean(QYTConfig.class); |
| | | |
| | | |
| | | /** |
| | | * 发送短信验证码 |
| | | * @param phone |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String queryCaptcha(String phone) throws Exception{ |
| | | HttpRequest post = HttpUtil.createPost(qytConfig.getChuxingUrl() + "/user-server/base/queryCaptcha"); |
| | | post.form("phone", phone); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("打车系统-发送验证码失败:{}", execute.body()); |
| | | return null; |
| | | } |
| | | return execute.body(); |
| | | } |
| | | |
| | | /** |
| | | * 验证短信验证码 |
| | | * @param phone |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Boolean checkCaptcha(String phone, String code) throws Exception{ |
| | | HttpRequest post = HttpUtil.createPost(qytConfig.getChuxingUrl() + "/user-server/base/user/checkCaptcha"); |
| | | post.header("device", "driving"); |
| | | post.form("phone", phone); |
| | | post.form("code", code); |
| | | HttpResponse execute = post.execute(); |
| | | if(200 != execute.getStatus()){ |
| | | log.error("打车系统-验证短信验证码:{}", execute.body()); |
| | | return null; |
| | | } |
| | | return Boolean.valueOf(execute.body()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加用户 |