Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
264fd5ef
Commit
264fd5ef
authored
May 29, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 一键登录
parent
1c7ecce8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
31 deletions
+41
-31
YHLoginMethodManager.swift
...sses/Modules/AutoLogin(一键登录)/M/YHLoginMethodManager.swift
+34
-27
YHOtherLoginViewController.swift
...sses/Modules/Login(登录)/C/YHOtherLoginViewController.swift
+5
-3
YHMyViewController.swift
...alaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
+2
-1
No files found.
galaxy/galaxy/Classes/Modules/AutoLogin(一键登录)/M/YHLoginMethodManager.swift
View file @
264fd5ef
...
...
@@ -22,8 +22,11 @@ extension YHLoginMethodManager {
if
!
support
{
YHHUD
.
flash
(
message
:
"不支持一键登录"
)
// 跳转APP自定义登录界面
let
vc
=
YHOtherLoginViewController
()
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
return
}
// 支持一键登录
YHLoginMethodManager
.
shared
.
enterAutoLoginPage
()
}
}
...
...
@@ -80,30 +83,7 @@ extension YHLoginMethodManager {
return
}
if
code
==
PNSCodeLoginControllerPresentSuccess
{
printLog
(
"弹起授权页成功"
)
}
else
if
code
==
PNSCodeLoginControllerClickCancel
{
printLog
(
"点击了授权页的返回"
)
}
else
if
code
==
PNSCodeLoginControllerClickChangeBtn
{
printLog
(
"点击切换其他登录方式按钮"
)
}
else
if
code
==
PNSCodeLoginControllerClickLoginBtn
{
if
let
isChecked
=
dict
[
"isChecked"
]
as?
Bool
,
isChecked
==
true
{
printLog
(
"点击了登录按钮,check box选中,SDK内部接着会去获取登录Token"
)
}
else
{
printLog
(
"点击了登录按钮,check box未选中,SDK内部不会去获取登录Token"
)
}
}
else
if
code
==
PNSCodeLoginControllerClickCheckBoxBtn
{
printLog
(
"点击了check box"
)
}
else
if
code
==
PNSCodeLoginControllerClickProtocol
{
printLog
(
"点击了协议富文本"
)
}
else
if
code
==
PNSCodeSuccess
{
if
code
==
PNSCodeSuccess
{
// 点击登录按钮获取登录Token成功回调
let
token
=
dict
[
"token"
]
as?
String
...
...
@@ -127,6 +107,34 @@ extension YHLoginMethodManager {
*/
return
}
// 以下是处理一键登录异常
if
code
==
PNSCodeLoginControllerPresentSuccess
{
printLog
(
"弹起授权页成功"
)
}
else
if
code
==
PNSCodeLoginControllerClickCancel
{
printLog
(
"点击了授权页的返回"
)
}
else
if
code
==
PNSCodeLoginControllerClickChangeBtn
{
printLog
(
"点击切换其他登录方式按钮"
)
}
else
if
code
==
PNSCodeLoginControllerClickLoginBtn
{
if
let
isChecked
=
dict
[
"isChecked"
]
as?
Bool
,
isChecked
==
true
{
printLog
(
"点击了登录按钮,check box选中,SDK内部接着会去获取登录Token"
)
}
else
{
printLog
(
"点击了登录按钮,check box未选中,SDK内部不会去获取登录Token"
)
}
}
else
if
code
==
PNSCodeLoginControllerClickCheckBoxBtn
{
printLog
(
"点击了check box"
)
}
else
if
code
==
PNSCodeLoginControllerClickProtocol
{
printLog
(
"点击了协议富文本"
)
}
else
{
printLog
(
"获取登录Token失败"
)
}
...
...
@@ -193,10 +201,9 @@ extension YHLoginMethodManager {
videoBgView
.
closeBlock
=
{
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
}
// 改变登录方式
videoBgView
.
changeLoginBlock
=
{
// let vc = UINavigationController(rootVC: YHPhoneLoginWithVideoBkgViewController())
let
vc
=
YHPhoneLoginWithVideoBkgViewController
()
// vc.modalPresentationStyle = .custom
let
vc
=
YHOtherLoginViewController
()
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
model
.
customViewBlock
=
{
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHOtherLoginViewController.swift
View file @
264fd5ef
...
...
@@ -319,8 +319,10 @@ class YHOtherLoginViewController: YHBaseViewController {
@objc
func
appleLogin
()
{
//第一次appid登录跳转逻辑
let
vc
=
YHOtherLoginViewController
()
vc
.
type
=
.
apple
navigationController
?
.
pushViewController
(
vc
)
// let vc = YHOtherLoginViewController()
// vc.type = .apple
// navigationController?.pushViewController(vc)
YHAppleLoginManager
.
shared
.
appleLogin
()
}
}
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
View file @
264fd5ef
...
...
@@ -99,7 +99,8 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
view
.
avatarClickBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
if
!
checkLogin
()
{
return
}
// if !checkLogin() { return }
YHLoginMethodManager
.
shared
.
autoLogin
()
}
view
.
nickNameClickBlock
=
{
[
weak
self
]
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment