From 1df231fd6aafa221aef3532d069c7e27d4331be7 Mon Sep 17 00:00:00 2001 From: Linjiajia <319408893@qq.com> Date: 星期日, 27 八月 2023 19:21:01 +0800 Subject: [PATCH] 功能全部完成 --- app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivityViewModel.java | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivityViewModel.java b/app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivityViewModel.java index 74b66c9..ed4edcc 100644 --- a/app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivityViewModel.java +++ b/app/src/main/java/com/application/zhangshi_app_android/ui/login/LoginActivityViewModel.java @@ -38,6 +38,7 @@ private MutableLiveData<String> againPassword = new MutableLiveData<>(); private MutableLiveData<Boolean> passwordVisibility = new MutableLiveData<>(); private MutableLiveData<Boolean> againPasswordVisibility = new MutableLiveData<>(); + private MutableLiveData<String> selectLoginBackgroundLiveData = new MutableLiveData<>();//鑳屾櫙鍥� private MutableLiveData<String> value = new MutableLiveData<>(); public LoginActivityViewModel(@NonNull Application application) { @@ -92,7 +93,7 @@ return; } if (captchaImageLiveData.getValue() != null){ - model.login(new LoginRequestBean(username.getValue(),password.getValue(),captchaImageLiveData.getValue().getValue(),captchaImageLiveData.getValue().getUuid())) + model.login(new LoginRequestBean(username.getValue(),password.getValue(),value.getValue(),captchaImageLiveData.getValue().getUuid())) .compose(RxUtils.schedulersTransformer()) .subscribe(new Observer<ResultData<LoginResponseBean>>() { @Override @@ -105,8 +106,9 @@ if (loginResponseBeanResultData.getCode() == CODE_SUCCESS){ String token = loginResponseBeanResultData.getData().getToken(); UserManager.getInstance().setToken(token); - ToastUtils.showShort("鐧婚檰鎴愬姛"); AppManager.getAppManager().startActivity(MainActivity.class); + AppManager.getAppManager().finishCurrentActivity(); + ToastUtils.showShort("鐧婚檰鎴愬姛"); }else { changeStateView(StateViewEnum.DATA_ERROR); messageLiveData.postValue(loginResponseBeanResultData.getMsg()); @@ -226,4 +228,12 @@ public void setValue(MutableLiveData<String> value) { this.value = value; } + + public MutableLiveData<String> getSelectLoginBackgroundLiveData() { + return selectLoginBackgroundLiveData; + } + + public void setSelectLoginBackgroundLiveData(MutableLiveData<String> selectLoginBackgroundLiveData) { + this.selectLoginBackgroundLiveData = selectLoginBackgroundLiveData; + } } -- Gitblit v1.9.1