| | |
| | | |
| | | import java.io.File; |
| | | |
| | | import cn.flightfeather.thirdapp.bean.Userinfo; |
| | | import cn.flightfeather.thirdapp.bean.entity.Userinfo; |
| | | import cn.flightfeather.thirdapp.common.net.RetrofitFactory; |
| | | import cn.flightfeather.thirdapp.util.crashreport.MyCrashHandler; |
| | | import retrofit2.Retrofit; |
| | |
| | | |
| | | public class CommonApplication extends Application { |
| | | // private final String ROOTURL="http://106.14.187.51:8801/supervision/"; |
| | | private final String ROOTURL="http://192.168.0.200:8080/"; |
| | | private final String ROOTURL_IMAGE="http://192.168.0.200:8080/images/"; |
| | | private final String ROOTURL_REALEASE = "http://47.100.191.150:9005/"; |
| | | public final String ROOTURL_REALEASE_IMAGE = "http://47.100.191.150:9005/images/"; |
| | | public final String ROOT_URL ="http://192.168.0.200:8080/"; |
| | | public final String ROOT_URL_IMAGE ="http://192.168.0.200:8080/images/"; |
| | | public final String ROOT_URL_RELEASE = "http://47.100.191.150:9005/"; |
| | | public final String ROOT_URL_RELEASE_IMAGE = "http://47.100.191.150:9005/images/"; |
| | | private Retrofit retrofit; |
| | | private Retrofit retrofitImage; |
| | | private DaoSession daoSession; |
| | |
| | | |
| | | if (released){ |
| | | retrofit = new Retrofit.Builder() |
| | | .baseUrl(ROOTURL_REALEASE) |
| | | .baseUrl(ROOT_URL_RELEASE) |
| | | .addConverterFactory(GsonConverterFactory.create(gson)) |
| | | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) |
| | | .build(); |
| | | }else { |
| | | retrofit = new Retrofit.Builder() |
| | | .baseUrl(ROOTURL) |
| | | .baseUrl(ROOT_URL) |
| | | .addConverterFactory(GsonConverterFactory.create(gson)) |
| | | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) |
| | | .build(); |
| | |
| | | .create(); |
| | | if (released){ |
| | | retrofitImage = new Retrofit.Builder() |
| | | .baseUrl(ROOTURL_REALEASE_IMAGE) |
| | | .baseUrl(ROOT_URL_RELEASE_IMAGE) |
| | | .addConverterFactory(GsonConverterFactory.create(gson)) |
| | | .build(); |
| | | }else { |
| | | retrofitImage = new Retrofit.Builder() |
| | | .baseUrl(ROOTURL_IMAGE) |
| | | .baseUrl(ROOT_URL_IMAGE) |
| | | .addConverterFactory(GsonConverterFactory.create(gson)) |
| | | .build(); |
| | | } |