From db0aaa2033a43c016ca165513faaee993117ecf8 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 22 八月 2025 12:14:14 +0800 Subject: [PATCH] 修改bug --- user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/util/AppUserUtil.java | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/util/AppUserUtil.java b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/util/AppUserUtil.java index 60d7cf2..4649170 100644 --- a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/util/AppUserUtil.java +++ b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/system/util/AppUserUtil.java @@ -3,6 +3,7 @@ import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; +import com.supersavedriving.user.config.QYTConfig; import lombok.extern.slf4j.Slf4j; /** @@ -12,10 +13,10 @@ */ @Slf4j public class AppUserUtil { + + private static QYTConfig qytConfig = SpringContextsUtil.getBean(QYTConfig.class); - private static String url = "http://127.0.0.1:8080/user-server"; - - + /** * 发送短信验证码 * @param phone @@ -23,7 +24,7 @@ * @throws Exception */ public static String queryCaptcha(String phone) throws Exception{ - HttpRequest post = HttpUtil.createPost(url + "/base/queryCaptcha"); + HttpRequest post = HttpUtil.createPost(qytConfig.getChuxingUrl() + "/user-server/base/queryCaptcha"); post.form("phone", phone); HttpResponse execute = post.execute(); if(200 != execute.getStatus()){ @@ -41,7 +42,7 @@ * @throws Exception */ public static Boolean checkCaptcha(String phone, String code) throws Exception{ - HttpRequest post = HttpUtil.createPost(url + "/base/user/checkCaptcha"); + HttpRequest post = HttpUtil.createPost(qytConfig.getChuxingUrl() + "/user-server/base/user/checkCaptcha"); post.header("device", "driving"); post.form("phone", phone); post.form("code", code); @@ -61,7 +62,7 @@ * @throws Exception */ public static String addUser(String phone, String code, String areaCode) throws Exception{ - HttpRequest post = HttpUtil.createPost(url + "/base/user/addAppUser"); + HttpRequest post = HttpUtil.createPost(qytConfig.getChuxingUrl() + "/user-server/base/user/addAppUser"); post.form("phone", phone); post.form("code", code); post.form("areaCode", areaCode); @@ -72,4 +73,22 @@ } return execute.body(); } + + + + /** + * 通过 + * @param id + * @return + * @throws Exception + */ + public static String getUserPhone(Integer id) throws Exception{ + HttpRequest post = HttpUtil.createGet(qytConfig.getChuxingUrl() + "/user-server/base/user/getUserPhone/" + id); + HttpResponse execute = post.execute(); + if(200 != execute.getStatus()){ + log.error("打车系统-查询用户失败:{}", execute.body()); + return null; + } + return execute.body(); + } } -- Gitblit v1.7.1