From b436c8d59d829f158ed059e3fecf0dc6151c4719 Mon Sep 17 00:00:00 2001 From: bayuzhen Date: Wed, 28 Aug 2024 20:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A9=E8=9E=8D=E4=BF=A1?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=9A=8F=E6=9C=BA=E6=95=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bocloud/sms/service/TrxServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java index 4088ba7..0b388a0 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/TrxServiceImpl.java @@ -1,6 +1,8 @@ package com.bocloud.sms.service; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -54,13 +56,16 @@ public class TrxServiceImpl implements TrxService { @Override public GeneralResult getRandomstr(String ngxCookie) { String url = trxUrl + "/getRandomStr"; - Map paramsMap = new HashMap<>(); - paramsMap.put("isToken", false); + Map paramsMap = new HashMap<>(); + paramsMap.put("isToken", "false"); paramsMap.put("ngx_cookie", ngxCookie); JSONObject result = new JSONObject(); try { log.info("调用天融信获取随机字符串接口, url:" + url + ", 参数:" + JSONObject.toJSONString(paramsMap)); - result = JSONObject.parseObject(HttpUtil.get(url, paramsMap, 10000)); + HttpResponse response = HttpRequest.get(url) + .addHeaders(paramsMap) + .execute(); + result = JSONObject.parseObject(response.body()); if ("-1".equals(result.getString("result"))) { return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg")); } @@ -224,6 +229,7 @@ public class TrxServiceImpl implements TrxService { // 获取天融信用户在权限系统的门户应用的菜单 public List queryQxCategoryList(String userToken ,String userId) { List appModules = JSONArray.parseArray(qxUtils.queryAppModules(userToken, userId), AppModule.class); + log.info("获取用户在指定应用中可操作的功能模块信息结果:" + JSONObject.toJSONString(appModules)); return appModules; }