|
|
@@ -14,6 +14,7 @@ import com.datarecovery.master.R;
|
|
|
import com.datarecovery.master.data.api.response.CustomerUrlResponse;
|
|
|
import com.datarecovery.master.data.consts.ChannelHelper;
|
|
|
import com.datarecovery.master.data.consts.ChannelId;
|
|
|
+import com.datarecovery.master.data.consts.ErrorCode;
|
|
|
import com.datarecovery.master.data.consts.EventId;
|
|
|
import com.datarecovery.master.data.repositories.AccountRepository;
|
|
|
import com.datarecovery.master.data.repositories.ConfigRepository;
|
|
|
@@ -30,6 +31,8 @@ import com.datarecovery.master.module.wxrecover.WeChatRecoverActivity;
|
|
|
import com.datarecovery.master.sdk.qiyu.QiYuHelper;
|
|
|
import com.datarecovery.master.sdk.wechat.WechatHelper;
|
|
|
import com.datarecovery.master.utils.BoxingUtil;
|
|
|
+import com.datarecovery.master.utils.ReportUtil;
|
|
|
+import com.datarecovery.master.utils.RxHttpHandler;
|
|
|
import com.datarecovery.master.utils.ToastUtil;
|
|
|
import com.qiyukf.unicorn.api.Unicorn;
|
|
|
|
|
|
@@ -151,8 +154,29 @@ public class MineViewModel extends BaseViewModel {
|
|
|
}
|
|
|
|
|
|
public void onAccountLogout() {
|
|
|
- QiYuHelper.logout();
|
|
|
- accountRepository.logout();
|
|
|
+ accountRepository.userDeprecate().subscribe(new SingleObserver<Object>() {
|
|
|
+ @Override
|
|
|
+ public void onSubscribe(@NonNull Disposable d) {
|
|
|
+ addDisposable(d);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onSuccess(@NonNull Object object) {
|
|
|
+ ToastUtil.show(R.string.account_logout_success, ToastUtil.LENGTH_SHORT);
|
|
|
+ QiYuHelper.logout();
|
|
|
+ accountRepository.logout();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(@NonNull Throwable throwable) {
|
|
|
+ if (throwable instanceof RxHttpHandler.ServerErrorException) {
|
|
|
+ RxHttpHandler.ServerErrorException serverErrorException = (RxHttpHandler.ServerErrorException) throwable;
|
|
|
+ ToastUtil.show(serverErrorException.getMsg(), ToastUtil.LENGTH_SHORT);
|
|
|
+ } else {
|
|
|
+ ToastUtil.show(R.string.net_error, ToastUtil.LENGTH_SHORT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
public void onFeedbackClick() {
|