From cfe408a020b79def34070c9329802a6627cf5d05 Mon Sep 17 00:00:00 2001 From: xusd <hugeinfo123> Date: Sat, 14 Sep 2024 09:48:02 +0800 Subject: [PATCH] token调试 --- dyh-service/dyh-sys/src/main/java/cn/huge/module/grid/service/GridUserService.java | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 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 182bdd1..5bc1fc6 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 @@ -2,25 +2,32 @@ import cn.huge.base.common.bo.R; import cn.huge.base.common.utils.HttpClientUtils; -import cn.huge.module.grid.domain.vo.GridUserVo; +import cn.huge.module.grid.domain.vo.*; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.HashMap; +import java.util.UUID; @Slf4j @Service public class GridUserService { private String gridUrl = "http://219.137.166.84:8061"; + private String testUrl = "http://183.2.142.46:9007"; - public R<GridUserVo> getUserInfo(String token) { + public R<GridUserVo> getUserInfo(GridTokenVo gridTokenVo) { String s = null; + HeadVo headVo = initHeadVo(); + GridUserRequestVo requestVo = new GridUserRequestVo(); + requestVo.setHeadVo(headVo); + requestVo.setBodyVo(gridTokenVo); try { - log.info("xsd:{}",JSON.toJSONString(token)); - log.info("xsdurl:{}",gridUrl + "/sys/getUserByToken"); - s = HttpClientUtils.httpPostRaw(gridUrl + "/sys/getUserByToken", JSON.toJSONString(token), 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(testUrl + "/api/thrid/grid/user/get-userinfo", JSON.toJSONString(requestVo), new HashMap<>(), "utf-8"); log.info("xsd:{}",s); } catch (Exception e) { log.info("xsderror:{}",e.getLocalizedMessage()); @@ -29,4 +36,13 @@ GridUserVo gridUserVo = JSONObject.parseObject(s).getObject("data", GridUserVo.class); return R.ok(gridUserVo); } + + public HeadVo initHeadVo() { + HeadVo headVo = new HeadVo(); + headVo.setUsername("mtxt001"); + headVo.setPassword("aek8CdcaM"); + headVo.setRequestId(UUID.randomUUID().toString()); + headVo.setSource("string"); + return headVo; + } } -- Gitblit v1.8.0