diff --git a/yinmeng-ios/AppDelegate.swift b/yinmeng-ios/AppDelegate.swift index c198f27..f0030d7 100644 --- a/yinmeng-ios/AppDelegate.swift +++ b/yinmeng-ios/AppDelegate.swift @@ -17,7 +17,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UIApplication.shared.applicationIconBadgeNumber = 0 self.window = UIWindow.init(frame: UIScreen.main.bounds) self.window?.backgroundColor = UIColor.white - self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC()) + + showLoginPage() loadNIMSDK() loginStateListener() @@ -31,21 +32,31 @@ class AppDelegate: UIResponder, UIApplicationDelegate { guard let strongSelf = self else { return } if result == true { - ///如果登录成功显示tabbar - strongSelf.window?.rootViewController = BaseTabBarViewController() let uid = AuthManager.userUid if uid > 0 { UserViewModel.userVM.getUserInfo(uid: uid) } + + strongSelf.showTabbar() + + // MARK: 目前没有使用云信的场景 if NIMSDK.shared().loginManager.isLogined() == false { - if let uid = LoginTokenConfig.config.getAccountInfo()?.uid, let token = LoginTokenConfig.config.getAccountInfo()?.netEaseToken { + if let uid = LoginTokenConfig.config.getAccountInfo()?.uid, + let token = LoginTokenConfig.config.getAccountInfo()?.netEaseToken { NIMSDK.shared().loginManager.login("\(uid)", token: token) { error in + guard let error else { +// strongSelf.showTabbar() + return + } print("login error: \(String(describing: error))") +// strongSelf.showLoginPage() } } else { - strongSelf.showLoginPage() +// strongSelf.showLoginPage() } - } + } else { +// strongSelf.showTabbar() + } } else { strongSelf.showLoginPage() } @@ -65,6 +76,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { self.window?.rootViewController = BaseNavigationViewController(rootViewController:AuthLaunchVC()) } + private func showTabbar() { + ///如果登录成功显示tabbar + self.window?.rootViewController = BaseTabBarViewController() + } + private func loadNIMSDK() { let opt = NIMSDKOption(appKey: AppKeys.nimAppid) opt.apnsCername = "yinmeng_anps" diff --git a/yinmeng-ios/Modules/Auth/VC/AuthLaunchVC.swift b/yinmeng-ios/Modules/Auth/VC/AuthLaunchVC.swift index e174c4f..b209624 100644 --- a/yinmeng-ios/Modules/Auth/VC/AuthLaunchVC.swift +++ b/yinmeng-ios/Modules/Auth/VC/AuthLaunchVC.swift @@ -80,8 +80,6 @@ class AuthLaunchVC: BaseViewController, HiddenNavigationBarProtocol { make.bottom.equalTo(stackView.snp.top).offset(-56) } -// - appleView.snp.makeConstraints { make in make.width.equalTo(47) make.height.equalTo(70)