Commit 49a67b05 authored by Steven杜宇's avatar Steven杜宇

add : 一键登录

parent 32a2c5c7
......@@ -90,6 +90,7 @@ class YHLoginViewController: YHBaseViewController {
button.setTitle("本机号码一键登录", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 24
button.addTarget(self, action: #selector(aliCloudLogin), for: .touchUpInside)
return button
}()
view.addSubview(loginButton)
......@@ -188,3 +189,37 @@ class YHLoginViewController: YHBaseViewController {
//测试
}
}
extension YHLoginViewController {
@objc func aliCloudLogin() {
let handler = TXCommonHandler.sharedInstance()
handler.accelerateLoginPage(withTimeout:10) { [weak self] dic in
if dic == nil { return }
guard let self = self else { return }
let resultCode = dic["resultCode"] as? String
print("resultCode:\(resultCode)")
}
var model = TXCustomModel()
model.navColor = .orange
let attributes = [
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 20),
NSAttributedString.Key.foregroundColor: UIColor.white,
]
model.navTitle = NSAttributedString(string: "一键登录", attributes: attributes)
model.supportedInterfaceOrientations = UIInterfaceOrientationMask.portrait
handler.getLoginToken(withTimeout: 10.0, controller:self, model:model) { [weak self] dic in
guard let self = self else { 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