1. 修正登录页 UI 布局和文案
2. 调整首页 tab 关注逻辑
This commit is contained in:
@@ -19,21 +19,21 @@ var window: UIWindow?
|
||||
self.window = UIWindow.init(frame: UIScreen.main.bounds)
|
||||
self.window?.backgroundColor = UIColor.white
|
||||
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
|
||||
loadNIMSDK()
|
||||
loginStateListener()
|
||||
|
||||
loadNIMSDK()
|
||||
loginStateListener()
|
||||
return true
|
||||
}
|
||||
|
||||
private func loginStateListener() {
|
||||
AuthViewModel.authVM.appClientConfig()
|
||||
///检车是否已经登录
|
||||
AuthViewModel.authVM.checkUserIsLogin()
|
||||
AuthViewModel.authVM.loginSuccess.subscribe(onNext: { result in
|
||||
print("是否登录成功\(result)")
|
||||
AuthViewModel.authVM.loginSuccess.subscribe(onNext: { [weak self] result in
|
||||
guard let strongSelf = self else { return }
|
||||
|
||||
if result == true {
|
||||
///如果登录成功显示tabbar
|
||||
self.window?.rootViewController = BaseTabBarViewController()
|
||||
strongSelf.window?.rootViewController = BaseTabBarViewController()
|
||||
let uid = AuthManager.userUid
|
||||
if uid > 0 {
|
||||
UserViewModel.userVM.getUserInfo(uid: uid)
|
||||
@@ -41,29 +41,31 @@ var window: UIWindow?
|
||||
if NIMSDK.shared().loginManager.isLogined() == false {
|
||||
if let uid = LoginTokenConfig.config.getAccountInfo()?.uid, let token = LoginTokenConfig.config.getAccountInfo()?.netEaseToken {
|
||||
NIMSDK.shared().loginManager.login("\(uid)", token: token) { error in
|
||||
print("aaa")
|
||||
print("login error: \(String(describing: error))")
|
||||
}
|
||||
} else {
|
||||
///去登录
|
||||
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
|
||||
|
||||
strongSelf.showLoginPage()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
///去登录
|
||||
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
|
||||
strongSelf.showLoginPage()
|
||||
}
|
||||
}).disposed(by: rx.disposeBag)
|
||||
|
||||
UserViewModel.userVM.selfInfo.subscribe(onNext: { result in
|
||||
UserViewModel.userVM.selfInfo.subscribe(onNext: { [weak self] result in
|
||||
guard let strongSelf = self else { return }
|
||||
if result.nick?.count ?? 0 <= 0 || result.avatar?.count ?? 0 <= 0 {
|
||||
let fillVC = AuthFillDataVC()
|
||||
fillVC.modalPresentationStyle = .fullScreen
|
||||
self.window?.rootViewController = fillVC
|
||||
strongSelf.window?.rootViewController = fillVC
|
||||
}
|
||||
}).disposed(by: rx.disposeBag)
|
||||
}
|
||||
|
||||
private func showLoginPage() {
|
||||
self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC())
|
||||
}
|
||||
|
||||
private func loadNIMSDK() {
|
||||
let opt = NIMSDKOption(appKey: AppKeys.nimAppid)
|
||||
opt.apnsCername = "yinmeng_anps"
|
||||
|
Reference in New Issue
Block a user