From 5d320cd16c9fc2b45d0b9cbd7225febf42489f9e Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期一, 03 七月 2023 18:56:11 +0800 Subject: [PATCH] 2023年07月03日18:56:09 --- app/src/main/java/com/hdl/photovoltaic/internet/HttpClient.java | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/internet/HttpClient.java b/app/src/main/java/com/hdl/photovoltaic/internet/HttpClient.java index d8fce79..7b88b11 100644 --- a/app/src/main/java/com/hdl/photovoltaic/internet/HttpClient.java +++ b/app/src/main/java/com/hdl/photovoltaic/internet/HttpClient.java @@ -86,12 +86,11 @@ @Override public void run() { try { - HdlLogLogic.print("http->鍙戦��->", fullUrl + "\r\n" + json); OkHttpClient okHttpClient = new OkHttpClient(); RequestBody requestBody = FormBody.create(MediaType.parse("application/json; charset=utf-8"), getJson(json)); final Request request = new Request.Builder() - .url(fullUrl)//璇锋眰鐨剈rl// + .url(fullUrl)//璇锋眰鐨剈rl .addHeader("Authorization", UserConfigManage.getInstance().getHeaderPrefix() + UserConfigManage.getInstance().getToken()) .post(requestBody) .build(); @@ -100,8 +99,9 @@ if (response.isSuccessful()) { String s = Objects.requireNonNull(response.body()).string(); HttpResponsePack httpResponsePack = new Gson().fromJson(s, HttpResponsePack.class); - baseSuccessCallBeak.onSuccess(httpResponsePack); HdlLogLogic.print("http->鍥炲->", response.request().url() + "\r\n" + s); + baseSuccessCallBeak.onSuccess(httpResponsePack); + } else { //throw new IOException("Unexpected code " + response); baseSuccessCallBeak.onFailure(new Exception()); @@ -112,7 +112,6 @@ call.enqueue(new Callback() {//寮傛 @Override public void onFailure(@NonNull Call call, @NonNull IOException e) { - System.out.println("澶辫触" + e.toString()); HdlLogLogic.print("http->鍥炲->", "\r\n" + e.getMessage()); } -- Gitblit v1.8.0