jsdw_ios/QuickLocation/Section/Mine/Account/AccountVC.swift

53 lines
1.3 KiB
Swift

//
// AccountVC.swift
// QuickLocation
//
// Created by on 2026/6/10.
//
import UIKit
import RxSwift
import RxCocoa
import RxDataSources
class AccountVC: BaseViewController {
fileprivate var rootView: AccountView!
override func loadView() {
rootView = AccountView(frame: UIScreen.main.bounds)
view = rootView
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
reactiveAction()
}
private func reactiveAction() {
rootView.logoutBtn.rx.tap.subscribe(onNext: { _ in
self.showConfirmPop(title: "温馨提醒",
message: "确定要退出账号吗?",
confirmText: "",
confirmBlock: { },
cancelText: "") {
self.requestLogout()
}
}).disposed(by: disposeBag)
}
// MARK: - API
private func requestLogout() {
DLToast.showLoading()
UserService.logout().subscribe { response in
DLToast.dismiss()
AppContextManager.shared.deleteAccount()
GroupIMService.shared.logout()
AppDelegate.shared.showMainViewController()
}.disposed(by: disposeBag)
}
}