53 lines
1.3 KiB
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)
|
|
}
|
|
}
|