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
5c18623b
Commit
5c18623b
authored
Jun 03, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加隐私协议弹窗前置
parent
7e714463
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
54 deletions
+93
-54
YHOtherLoginViewController.swift
...sses/Modules/Login(登录)/C/YHOtherLoginViewController.swift
+93
-54
No files found.
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHOtherLoginViewController.swift
View file @
5c18623b
...
...
@@ -326,76 +326,115 @@ class YHOtherLoginViewController: YHBaseViewController {
}
@objc
func
wechatLogin
()
{
let
login
=
YHShareManager
.
shared
login
.
sendLogin
()
login
.
success
=
{
[
weak
self
]
unionId
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
wxlogin
(
unionId
:
unionId
,
phone
:
""
,
code
:
""
)
{[
weak
self
]
success
,
error
in
if
privacyView
.
isAgree
{
let
login
=
YHShareManager
.
shared
login
.
sendLogin
()
login
.
success
=
{
[
weak
self
]
unionId
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHLoginManager
.
shared
.
loginSuccessActionBlock
?()
YHHUD
.
flash
(
message
:
"登录成功"
)
self
.
dismiss
(
animated
:
true
)
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
self
.
navigationController
?
.
popToRootViewController
(
animated
:
true
)
}
else
{
if
error
?
.
errorCode
==
30001
{
//第一次微信登录跳转逻辑
let
vc
=
YHOtherLoginViewController
()
vc
.
type
=
.
wechat
vc
.
token
=
unionId
navigationController
?
.
pushViewController
(
vc
)
self
.
viewModel
.
wxlogin
(
unionId
:
unionId
,
phone
:
""
,
code
:
""
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHLoginManager
.
shared
.
loginSuccessActionBlock
?()
YHHUD
.
flash
(
message
:
"登录成功"
)
self
.
dismiss
(
animated
:
true
)
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
self
.
navigationController
?
.
popToRootViewController
(
animated
:
true
)
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
if
error
?
.
errorCode
==
30001
{
//第一次微信登录跳转逻辑
let
vc
=
YHOtherLoginViewController
()
vc
.
type
=
.
wechat
vc
.
token
=
unionId
navigationController
?
.
pushViewController
(
vc
)
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
}
}
}
}
else
{
let
view
=
YHPrivacyAlertView
(
frame
:
view
.
bounds
)
view
.
urlBlock
=
{
[
weak
self
]
(
type
,
url
)
in
guard
let
self
=
self
else
{
return
}
let
vc
=
YHWebViewViewController
()
vc
.
url
=
url
if
type
==
0
{
vc
.
navTitle
=
"银河港生活隐私政策"
}
else
if
type
==
1
{
vc
.
navTitle
=
"银河港生活用户条款"
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
view
.
agreeBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
privacyView
.
isAgree
=
true
self
.
wechatLogin
()
}
self
.
view
.
addSubview
(
view
)
}
}
@objc
func
appleLogin
()
{
//第一次appid登录跳转逻辑
// let vc = YHOtherLoginViewController()
// vc.type = .apple
// navigationController?.pushViewController(vc)
YHAppleLoginManager
.
shared
.
success
=
{
dict
in
YHHUD
.
flash
(
message
:
"登录中..."
)
self
.
appleLoginViewModel
.
appleLogin
(
params
:
dict
)
{
success
,
error
in
if
privacyView
.
isAgree
{
YHAppleLoginManager
.
shared
.
success
=
{
dict
in
YHHUD
.
hide
()
if
success
{
YHLoginManager
.
shared
.
loginSuccessActionBlock
?()
YHHUD
.
flash
(
message
:
"登录成功"
)
self
.
dismiss
(
animated
:
true
)
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
self
.
navigationController
?
.
popToRootViewController
(
animated
:
true
)
return
}
if
let
err
=
error
{
var
msg
=
err
.
errorMsg
if
msg
.
isEmpty
{
msg
=
"登录失败"
YHHUD
.
flash
(
message
:
"登录中..."
)
self
.
appleLoginViewModel
.
appleLogin
(
params
:
dict
)
{
success
,
error
in
YHHUD
.
hide
()
if
success
{
YHLoginManager
.
shared
.
loginSuccessActionBlock
?()
YHHUD
.
flash
(
message
:
"登录成功"
)
self
.
dismiss
(
animated
:
true
)
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
self
.
navigationController
?
.
popToRootViewController
(
animated
:
true
)
return
}
YHHUD
.
flash
(
message
:
msg
)
if
err
.
errorCode
==
30001
{
// 首次登录,没有传电话号码和验证码返回错误码:30001
// 进入手机绑定页面
let
bindVC
=
YHOtherLoginViewController
()
bindVC
.
type
=
.
apple
bindVC
.
appleLoginParams
=
dict
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
bindVC
)
return
if
let
err
=
error
{
var
msg
=
err
.
errorMsg
if
msg
.
isEmpty
{
msg
=
"登录失败"
}
YHHUD
.
flash
(
message
:
msg
)
if
err
.
errorCode
==
30001
{
// 首次登录,没有传电话号码和验证码返回错误码:30001
// 进入手机绑定页面
let
bindVC
=
YHOtherLoginViewController
()
bindVC
.
type
=
.
apple
bindVC
.
appleLoginParams
=
dict
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
bindVC
)
return
}
}
}
}
YHAppleLoginManager
.
shared
.
appleLogin
()
}
else
{
let
view
=
YHPrivacyAlertView
(
frame
:
view
.
bounds
)
view
.
urlBlock
=
{
[
weak
self
]
(
type
,
url
)
in
guard
let
self
=
self
else
{
return
}
let
vc
=
YHWebViewViewController
()
vc
.
url
=
url
if
type
==
0
{
vc
.
navTitle
=
"银河港生活隐私政策"
}
else
if
type
==
1
{
vc
.
navTitle
=
"银河港生活用户条款"
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
view
.
agreeBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
self
.
privacyView
.
isAgree
=
true
self
.
appleLogin
()
}
self
.
view
.
addSubview
(
view
)
}
YHAppleLoginManager
.
shared
.
appleLogin
()
}
}
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