登录流程完善
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user