Commit 3d3ba9d2 by 李进峰

请求参数uid添加及转码

parent 87733188
......@@ -124,7 +124,7 @@ public class OkHttp3Utils {
urlBuild.addQueryParameter("uid", uid);
builder.headers(headBuilder.build()).post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), requestJsonStr));
builder.url(urlBuild.build()).headers(headBuilder.build()).post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), requestJsonStr));
Response response = client.newCall(builder.build()).execute();
try (ResponseBody body = response.body()){
return body.string();
......
......@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
/**
......@@ -98,7 +99,13 @@ public class RequestTerminal {
requestPojo.setUid(userId);
requestPojo.setMsg(XiaoAiConstants.TTS.END_WORD);
String requestJsonStr = JSON.toJSONString(requestPojo);
OkHttp3Utils.xiaoaiBackPostAsync(ScheduleServiceNew.BASE_HOST_URL+"?uid="+userId, requestJsonStr, type);
String uid = userId;
try {
uid = URLEncoder.encode(userId, "UTF-8");
}catch(Exception e) {
uid = userId;
}
OkHttp3Utils.xiaoaiBackPostAsync(ScheduleServiceNew.BASE_HOST_URL+"?uid="+uid, requestJsonStr, type);
// if (userId.equals(XiaoAiService.deviceId)) {
// OkHttp3Utils.backPostAsync(XiaoAiConstants.QI_WU_TERMINATE_DIDI, requestJsonStr, type);
// }else {
......
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