|
@@ -26,6 +26,7 @@ import net.posprinter.IDeviceConnection;
|
|
|
import net.posprinter.POSConnect;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.logging.Level;
|
|
|
|
|
|
import androidx.multidex.MultiDex;
|
|
@@ -152,9 +153,11 @@ public class BaseApplication extends Application {
|
|
|
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.NONE);
|
|
|
}
|
|
|
loggingInterceptor.setColorLevel(Level.INFO);
|
|
|
-
|
|
|
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
|
|
+ builder.writeTimeout(30*1000, TimeUnit.MILLISECONDS);
|
|
|
+ builder.readTimeout(30*1000, TimeUnit.MILLISECONDS);
|
|
|
OkGo.getInstance().init(this) //必须调用初始化
|
|
|
- .setOkHttpClient(new OkHttpClient.Builder()
|
|
|
+ .setOkHttpClient(builder
|
|
|
.addInterceptor(loggingInterceptor).build())
|
|
|
.addCommonHeaders(headers);
|
|
|
}
|