From 6ae0901878f342a9c1025c8edc302bdf03f58a6d Mon Sep 17 00:00:00 2001
From: xusd <hugeinfo123>
Date: Wed, 18 Sep 2024 17:37:00 +0800
Subject: [PATCH] 新增获取企业信息接口

---
 dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
index 5bc1fc6..b5837d3 100644
--- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
+++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java
@@ -6,6 +6,7 @@
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -14,7 +15,12 @@
 @Slf4j
 @Service
 public class GridUserService {
-    private String gridUrl = "http://219.137.166.84:8061";
+    @Value("${grid.url:http://219.137.166.84:8061}")
+    private String gridUrl;
+    @Value("${grid.username:mtxt0011}")
+    private String userName;
+    @Value("${grid.password:aek8CdcaM}")
+    private String passWord;
     private String testUrl = "http://183.2.142.46:9007";
 
     public R<GridUserVo> getUserInfo(GridTokenVo gridTokenVo) {
@@ -24,10 +30,10 @@
         requestVo.setHeadVo(headVo);
         requestVo.setBodyVo(gridTokenVo);
         try {
-            log.info("xsdobject:{}",JSON.toJSONString(requestVo));
-//            log.info("xsdurl:{}",gridUrl + "/sys/getUserByToken");
-            log.info("xsdurl:{}",testUrl + "/sys/getUserByToken");
-            s = HttpClientUtils.httpPostRaw(testUrl + "/api/thrid/grid/user/get-userinfo", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8");
+//            log.info("xsdobject:{}",JSON.toJSONString(requestVo));
+            log.info("xsdurl:{}",gridUrl + "/sys/getUserByToken");
+//            log.info("xsdurl:{}",testUrl + "/sys/getUserByToken");
+            s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/getUserByToken", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8");
             log.info("xsd:{}",s);
         } catch (Exception e) {
             log.info("xsderror:{}",e.getLocalizedMessage());
@@ -39,8 +45,8 @@
 
     public HeadVo initHeadVo() {
         HeadVo headVo = new HeadVo();
-        headVo.setUsername("mtxt001");
-        headVo.setPassword("aek8CdcaM");
+        headVo.setUsername(userName);
+        headVo.setPassword(passWord);
         headVo.setRequestId(UUID.randomUUID().toString());
         headVo.setSource("string");
         return headVo;

--
Gitblit v1.8.0