登录流程完善

This commit is contained in:
fengshuo
2024-02-25 23:11:02 +08:00
parent 94a067bdbc
commit 00f5414a88
9 changed files with 245 additions and 37 deletions

View File

@@ -23,22 +23,23 @@ var window: UIWindow?
}
private func loginStateListener() {
AuthViewModel.authVM.appClientConfig()
///
AuthViewModel.authVM.checkUserIsLogin()
AuthViewModel.authVM.loginSuccess.subscribe(onNext: { result in
print("是否登录成功\(result)")
if result == true {
///tabbar
self.window = UIWindow.init(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.white
self.window?.rootViewController = BaseTabBarViewController()
if let uid = LoginTokenConfig.config.getAccountInfo()?.uid {
UserViewModel.userVM.getUserInfo(uid: uid)
}
} else {
///
self.window = UIWindow.init(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.white
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLoginVC())
}
}).disposed(by: rx.disposeBag)
///
AuthViewModel.authVM.checkUserIsLogin()
}