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; }