Commit 93cb23e1 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent edc48c82
...@@ -3,6 +3,7 @@ package com.mortals.xhx.busiz.web; ...@@ -3,6 +3,7 @@ package com.mortals.xhx.busiz.web;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
...@@ -173,6 +174,36 @@ public class ProxyController { ...@@ -173,6 +174,36 @@ public class ProxyController {
return Rest.fail(response.code(), response.message()); return Rest.fail(response.code(), response.message());
// return ResponseEntity.status(response.code()).body(response.message()); // return ResponseEntity.status(response.code()).body(response.message());
} }
if ("/base/matter/channel/interlist".equals(path)) {
JSONObject rspJson = JSON.parseObject(response.body().string());
JSONObject data = rspJson.getJSONObject("data");
JSONArray dataJSONArray = data.getJSONArray("data");
for (int i = 0; i < dataJSONArray.size(); i++) {
JSONObject jsonObject = dataJSONArray.getJSONObject(i);
String icon = jsonObject.getString("icon");
if (!ObjectUtils.isEmpty(icon) && icon.startsWith("/file")) {
String filePath = uploadService.getFilePath(icon);
String base64Str = Base64.encode(new File(filePath));
log.info("base64Str:{}", base64Str);
jsonObject.put("icon", base64Str);
}
String qrCode = jsonObject.getString("qrCode");
if (!ObjectUtils.isEmpty(qrCode) && qrCode.startsWith("/file")) {
String filePath = uploadService.getFilePath(qrCode);
String base64Str = Base64.encode(new File(filePath));
log.info("base64Str:{}", base64Str);
jsonObject.put("qrCode", base64Str);
}
}
return Rest.ok("透传请求成功!", rspJson.toJSONString());
}
return Rest.ok("透传请求成功!", response.body().string()); return Rest.ok("透传请求成功!", response.body().string());
// return ResponseEntity.status(response.code()).body(response.body().string()); // return ResponseEntity.status(response.code()).body(response.body().string());
...@@ -196,8 +227,6 @@ public class ProxyController { ...@@ -196,8 +227,6 @@ public class ProxyController {
JSONObject rspJson = JSON.parseObject(resp); JSONObject rspJson = JSON.parseObject(resp);
JSONObject data = rspJson.getJSONObject("data"); JSONObject data = rspJson.getJSONObject("data");
String tid = data.getString("tid"); String tid = data.getString("tid");
if (!ObjectUtils.isEmpty(tid) && tid.startsWith("/file")) { if (!ObjectUtils.isEmpty(tid) && tid.startsWith("/file")) {
...@@ -211,11 +240,8 @@ public class ProxyController { ...@@ -211,11 +240,8 @@ public class ProxyController {
return Rest.ok("透传请求成功!", rspJson.toJSONString()); return Rest.ok("透传请求成功!", rspJson.toJSONString());
} }
} }
// rspJson.get
//String resp = HttpUtil.get(urlGet); //String resp = HttpUtil.get(urlGet);
return Rest.ok("透传请求成功!", resp); return Rest.ok("透传请求成功!", resp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment