doum
4 天以前 cb6aca0642ac8dd5de877ade168066d85acb589c
keyCabinet-android/app/src/main/java/com/doumee/keyCabinet/utils/update/UpdateUtil.java
@@ -16,7 +16,6 @@
import com.doumee.keyCabinet.http.param.BaseResponse;
import com.doumee.keyCabinet.http.param.DevAppVersionParam;
import com.doumee.keyCabinet.http.param.RequestBaseObject;
import com.doumee.keyCabinet.utils.ParamsUtil;
public class UpdateUtil {
    public static String newVerName = "";
@@ -70,29 +69,23 @@
    }
    private void getUpgradeInfo() {
        if (true) {
            return;
        }
        RequestBaseObject<DevAppVersionParam> request = new RequestBaseObject<>();
        DevAppVersionParam param = new DevAppVersionParam();
        param.setVersionCode(BuildConfig.VERSION_CODE);
        param.setType("2");
        request.setParam(param);
        activity.getVM().getRetrofitService(Apis.class).getVersion(MApplication.getConfigBean().getLanguage(),MApplication.getCookie(),MApplication.getConfigBean().getShopId(),
                        MApplication.getConfigBean().getGymId(), ParamsUtil.encodeRequestBody(request))
        activity.getVM().getRetrofitService(Apis.class).getVersion()
                .compose(RxUtils.schedulersTransformer())
                .subscribe(new SimpleObserver<BaseResponse<AndroidVersionBean>>(activity.getVM().rxJavaGcManager) {
                    @Override
                    public void onNext(@NonNull BaseResponse<AndroidVersionBean> response) {
                        if ("000000".equals(response.getErrorCode())) {
                            if (response.getRecord()!=null) {
                                versionCallBack.isNeedUpdate(true);
                                AndroidVersionBean data = response.getRecord();
                                upgradeurl=data.getUpdateUrl();
                                updatelog=data.getUpdateContent();
                                newVerName = response.getRecord().getVersionName();
                                doNewVersionUpdate(true);
                                return;
                        if (200==response.getCode()) {
                            if (response.getData()!=null) {
                                AndroidVersionBean data = response.getData();
                                if(data!=null&&data.getVersionNum()!=null&&data.getVersionNum()>BuildConfig.VERSION_CODE){
                                    versionCallBack.isNeedUpdate(true);
                                    upgradeurl=data.getFullFileUrl();
                                    updatelog=data.getContent();
                                    newVerName = response.getData().getVersionInfo();
                                    doNewVersionUpdate(true);
                                }else {
                                    versionCallBack.isNeedUpdate(false);
                                }
                            }else {
                                versionCallBack.isNeedUpdate(false);
                            }