Skip to content

Commit

Permalink
'修复上传问题'
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelly committed Feb 28, 2020
1 parent 7eb2e5d commit bb4d4ff
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
14 changes: 10 additions & 4 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions corelibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ dependencies {
api 'com.github.bumptech.glide:glide:4.8.0'

api 'cat.ereza:customactivityoncrash:2.2.0'
testImplementation 'junit:junit:4.12'

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Map;

import okhttp3.Interceptor;
import okhttp3.RequestBody;


public class HttpHelper implements IHttpProcessor {
Expand Down Expand Up @@ -64,7 +65,7 @@ public void rxDownload(String url, DownHttpCallback downHttpCallback,String file
}

@Override
public void rxUpload(String url, UploadProgressRequestBody requestBody, OnSuccessAndFaultListener listener) {
public void rxUpload(String url, RequestBody requestBody, OnSuccessAndFaultListener listener) {
mHttpProcessor.rxUpload(url,requestBody,listener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Map;

import okhttp3.Interceptor;
import okhttp3.RequestBody;


public interface IHttpProcessor {
Expand All @@ -24,5 +25,5 @@ public interface IHttpProcessor {

void rxDownload(String url, DownHttpCallback downHttpCallback,String fileName);

void rxUpload(String url, UploadProgressRequestBody requestBody, OnSuccessAndFaultListener listener);
void rxUpload(String url, RequestBody requestBody, OnSuccessAndFaultListener listener);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private static Retrofit RETROFIT_CUSTOM_INTERCEPTOR(Interceptor interceptor) {
//单独配置okhttp
private static class OkHttpHolder {

private static final int TIME_OUT = 60;
private static final int TIME_OUT = 20;

private static OkHttpClient client = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Map;

import okhttp3.Interceptor;
import okhttp3.RequestBody;


public class RetrofitProcess implements IHttpProcessor {
Expand Down Expand Up @@ -132,7 +133,7 @@ public void rxDownload(String url, DownHttpCallback httpCallback,String fileName
}

@Override
public void rxUpload(String url, UploadProgressRequestBody requestBody, final OnSuccessAndFaultListener listener) {
public void rxUpload(String url, RequestBody requestBody, final OnSuccessAndFaultListener listener) {
RestClient.create().url(url)
.body(requestBody)
.listener(listener)
Expand Down

0 comments on commit bb4d4ff

Please sign in to comment.