上链添加转义

dongdingding
吴顺杰 11 months ago
parent 1fcb08e264
commit 016dda4202

@ -1,10 +1,10 @@
package com.ruoyi.zhiyuanzhe.utils;
import cn.hutool.core.util.IdUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.exception.ServiceException;
import org.apache.commons.text.StringEscapeUtils;
import java.util.HashMap;
import java.util.Map;
@ -29,8 +29,12 @@ public class PushDataUtil {
String key = IdUtil.simpleUUID();
Map<String, Object> param = new HashMap<>();
param.put("key", key);
param.put("elementjsonstr", StringEscapeUtils.escapeJson(elementjsonstr));
String result = HttpUtil.post(pushUrl, param);
param.put("elementjsonstr", elementjsonstr);
String body = JSONUtil.toJsonStr(param);
String result = HttpRequest.post(pushUrl)
.body(body)
.execute()
.body();
Map map = JSONObject.parseObject(result, Map.class);
System.err.println(map);
Object code = map.get("code");

Loading…
Cancel
Save