Commit d4293fc1 authored by Steven杜宇's avatar Steven杜宇

// 替换全局登录

parent ce56195a
...@@ -140,9 +140,7 @@ extension YHHKEventViewController { ...@@ -140,9 +140,7 @@ extension YHHKEventViewController {
YHShareManager.shared.sendLinkContent("一图看清香港办事", "", UIImage(named: "AppIcon") ?? UIImage(), link: urlString) YHShareManager.shared.sendLinkContent("一图看清香港办事", "", UIImage(named: "AppIcon") ?? UIImage(), link: urlString)
} }
} else { } else {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
} }
} }
} }
......
...@@ -255,9 +255,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate { ...@@ -255,9 +255,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
if YHLoginManager.shared.isLogin() { if YHLoginManager.shared.isLogin() {
return true return true
} else { } else {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
UIViewController.current?.navigationController?.present(vc, animated: true)
YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in YHLoginManager.shared.loginSuccessActionBlock = {[weak self] in
guard self != nil else { return } guard self != nil else { return }
tabBarController.selectedIndex = index tabBarController.selectedIndex = index
......
...@@ -80,9 +80,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -80,9 +80,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
view.likeBlock = { [weak self] flag in view.likeBlock = { [weak self] flag in
guard let self = self else { return } guard let self = self else { return }
if YHLoginManager.shared.isLogin() == false { if YHLoginManager.shared.isLogin() == false {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return return
} }
if flag { if flag {
...@@ -111,9 +109,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -111,9 +109,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
view.starBlock = { [weak self] flag in view.starBlock = { [weak self] flag in
guard let self = self else { return } guard let self = self else { return }
if YHLoginManager.shared.isLogin() == false { if YHLoginManager.shared.isLogin() == false {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return return
} }
if flag { if flag {
...@@ -244,9 +240,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -244,9 +240,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
task.resume() task.resume()
} }
} else { } else {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
} }
} }
......
...@@ -247,9 +247,7 @@ extension YHHomeCollectionViewCell { ...@@ -247,9 +247,7 @@ extension YHHomeCollectionViewCell {
} }
} }
} else { } else {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.parentViewController?.navigationController?.present(vc, animated: true)
} }
} }
......
...@@ -99,8 +99,8 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -99,8 +99,8 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
view.avatarClickBlock = { view.avatarClickBlock = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
// if !checkLogin() { return } if !checkLogin() { return }
YHLoginMethodManager.shared.autoLogin()
} }
view.nickNameClickBlock = { view.nickNameClickBlock = {
[weak self] in [weak self] in
...@@ -155,9 +155,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -155,9 +155,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
func checkLogin()->Bool { func checkLogin()->Bool {
if YHLoginManager.shared.isLogin() == false { if YHLoginManager.shared.isLogin() == false {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return false return false
} }
return true return true
...@@ -277,9 +275,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -277,9 +275,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
//#endif //#endif
if !checkLogin() { if !checkLogin() {
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return return
} }
......
...@@ -139,9 +139,7 @@ class YHVideoPlayerVC: YHBaseViewController { ...@@ -139,9 +139,7 @@ class YHVideoPlayerVC: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
if YHLoginManager.shared.isLogin() == false { if YHLoginManager.shared.isLogin() == false {
self.player.pause() self.player.pause()
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return return
} }
if flag { if flag {
...@@ -171,9 +169,7 @@ class YHVideoPlayerVC: YHBaseViewController { ...@@ -171,9 +169,7 @@ class YHVideoPlayerVC: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
if YHLoginManager.shared.isLogin() == false { if YHLoginManager.shared.isLogin() == false {
self.player.pause() self.player.pause()
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return return
} }
if flag { if flag {
...@@ -266,9 +262,7 @@ extension YHVideoPlayerVC { ...@@ -266,9 +262,7 @@ extension YHVideoPlayerVC {
if YHLoginManager.shared.isLogin() == false { if YHLoginManager.shared.isLogin() == false {
self.player.pause() self.player.pause()
let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController()) YHLoginMethodManager.shared.autoLogin()
vc.modalPresentationStyle = .custom
self.navigationController?.present(vc, animated: true)
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment