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
389a4796
Commit
389a4796
authored
May 30, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 更改类名和方法名
parent
07d1a9cd
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
64 additions
and
56 deletions
+64
-56
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+12
-12
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+1
-1
YHOneKeyLoginManager.swift
...sses/Modules/AutoLogin(一键登录)/M/YHOneKeyLoginManager.swift
+38
-30
YHOneKeyLoginView.swift
...Classes/Modules/AutoLogin(一键登录)/V/YHOneKeyLoginView.swift
+2
-2
YHHKEventViewController.swift
.../Classes/Modules/Home(首页)/C/YHHKEventViewController.swift
+1
-1
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+1
-1
YHHomeWebViewController.swift
.../Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
+3
-3
YHHomeCollectionViewCell.swift
...Classes/Modules/Home(首页)/V/YHHomeCollectionViewCell.swift
+1
-1
YHMyViewController.swift
...alaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
+2
-2
YHVideoPlayerVC.swift
galaxy/galaxy/Classes/Tools/VideoPlay/YHVideoPlayerVC.swift
+3
-3
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
389a4796
This diff is collapsed.
Click to expand it.
galaxy/galaxy/AppDelegate.swift
View file @
389a4796
...
@@ -47,7 +47,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
...
@@ -47,7 +47,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
}
}
// 一键登录
// 一键登录
YH
LoginMethodManager
.
shared
.
configAuto
Login
()
YH
OneKeyLoginManager
.
shared
.
configOneKey
Login
()
YHOSSManager
.
share
.
getOSSID
()
YHOSSManager
.
share
.
getOSSID
()
//1.设置主窗口
//1.设置主窗口
...
...
galaxy/galaxy/Classes/Modules/AutoLogin(一键登录)/M/YH
LoginMethod
Manager.swift
→
galaxy/galaxy/Classes/Modules/AutoLogin(一键登录)/M/YH
OneKeyLogin
Manager.swift
View file @
389a4796
...
@@ -9,15 +9,17 @@
...
@@ -9,15 +9,17 @@
import
UIKit
import
UIKit
import
AVFoundation
import
AVFoundation
class
YH
LoginMethod
Manager
{
class
YH
OneKeyLogin
Manager
{
static
let
shared
=
YHLoginMethodManager
()
static
let
shared
=
YHOneKeyLoginManager
()
// 是否加速取号成功
var
isAccelerateGetPhontNumberSuccess
=
false
}
}
extension
YH
LoginMethod
Manager
{
extension
YH
OneKeyLogin
Manager
{
func
auto
Login
()
{
func
oneKey
Login
()
{
YH
LoginMethodManager
.
shared
.
checkIsSupportAuto
Login
{
YH
OneKeyLoginManager
.
shared
.
checkIsSupportOneKey
Login
{
support
in
support
in
if
!
support
{
if
!
support
{
YHHUD
.
flash
(
message
:
"不支持一键登录"
)
YHHUD
.
flash
(
message
:
"不支持一键登录"
)
...
@@ -28,7 +30,7 @@ extension YHLoginMethodManager {
...
@@ -28,7 +30,7 @@ extension YHLoginMethodManager {
return
return
}
}
// 支持一键登录
// 支持一键登录
YH
LoginMethodManager
.
shared
.
enterAuto
LoginPage
()
YH
OneKeyLoginManager
.
shared
.
enterOneKey
LoginPage
()
}
}
}
}
...
@@ -36,14 +38,35 @@ extension YHLoginMethodManager {
...
@@ -36,14 +38,35 @@ extension YHLoginMethodManager {
return
TXCommonHandler
.
sharedInstance
()
.
getVersion
()
return
TXCommonHandler
.
sharedInstance
()
.
getVersion
()
}
}
func
configAutoLogin
()
{
func
configOneKeyLogin
()
{
TXCommonHandler
.
sharedInstance
()
.
setAuthSDKInfo
(
YhConstant
.
Alipay
.
kAliLoginSecretKey
)
{
TXCommonHandler
.
sharedInstance
()
.
setAuthSDKInfo
(
YhConstant
.
Alipay
.
kAliLoginSecretKey
)
{
dict
in
dict
in
printLog
(
dict
)
printLog
(
dict
)
}
}
TXCommonHandler
.
sharedInstance
()
.
accelerateLoginPage
(
withTimeout
:
10.0
)
{
dic
in
guard
let
code
=
dic
[
"resultCode"
]
as?
String
else
{
printLog
(
"加速取号失败"
)
YHOneKeyLoginManager
.
shared
.
isAccelerateGetPhontNumberSuccess
=
false
return
}
}
func
checkIsSupportAutoLogin
(
_
support
:((
Bool
)
->
())?)
{
if
code
!=
PNSCodeSuccess
{
printLog
(
"加速取号失败"
)
YHOneKeyLoginManager
.
shared
.
isAccelerateGetPhontNumberSuccess
=
false
return
}
// 加速取号成功
printLog
(
"加速取号成功"
)
YHOneKeyLoginManager
.
shared
.
isAccelerateGetPhontNumberSuccess
=
true
}
}
func
checkIsSupportOneKeyLogin
(
_
support
:((
Bool
)
->
())?)
{
// 检测当前环境是否支持一键登录
// 检测当前环境是否支持一键登录
TXCommonHandler
.
sharedInstance
()
.
checkEnvAvailable
(
with
:
.
loginToken
)
{
TXCommonHandler
.
sharedInstance
()
.
checkEnvAvailable
(
with
:
.
loginToken
)
{
dict
in
dict
in
...
@@ -56,24 +79,9 @@ extension YHLoginMethodManager {
...
@@ -56,24 +79,9 @@ extension YHLoginMethodManager {
}
}
}
}
func
enter
Auto
LoginPage
()
{
func
enter
OneKey
LoginPage
()
{
// 3. 开始一键登录流程
// 3. 开始一键登录流程
// 3.1 调用加速授权页弹起接口,提前获取必要参数,为后面弹起授权页加速
TXCommonHandler
.
sharedInstance
()
.
accelerateLoginPage
(
withTimeout
:
10.0
)
{
dic
in
guard
let
code
=
dic
[
"resultCode"
]
as?
String
else
{
YHHUD
.
flash
(
message
:
"取号,加速授权页弹起失败"
)
return
}
if
code
!=
PNSCodeSuccess
{
YHHUD
.
flash
(
message
:
"取号,加速授权页弹起失败"
)
return
}
//3.2 调用获取登录Token接口,可以立马弹起授权页,model的创建需要放在主线程
//3.2 调用获取登录Token接口,可以立马弹起授权页,model的创建需要放在主线程
let
model
=
self
.
createLoginUIModel
()
let
model
=
self
.
createLoginUIModel
()
TXCommonHandler
.
sharedInstance
()
.
getLoginToken
(
withTimeout
:
10.0
,
controller
:
UIViewController
.
current
!
,
model
:
model
)
{
TXCommonHandler
.
sharedInstance
()
.
getLoginToken
(
withTimeout
:
10.0
,
controller
:
UIViewController
.
current
!
,
model
:
model
)
{
...
@@ -86,8 +94,11 @@ extension YHLoginMethodManager {
...
@@ -86,8 +94,11 @@ extension YHLoginMethodManager {
if
code
==
PNSCodeSuccess
{
if
code
==
PNSCodeSuccess
{
// 点击登录按钮获取登录Token成功回调
// 点击登录按钮获取登录Token成功回调
let
token
=
dict
[
"token"
]
as?
String
guard
let
token
=
dict
[
"token"
]
as?
String
else
{
printLog
(
"获取登录Token失败"
)
return
}
printLog
(
"oneKeyLogin token:
\(
token
)
"
)
// 下面用Token去服务器换手机号,此处仅做参考
// 下面用Token去服务器换手机号,此处仅做参考
/*
/*
...
@@ -136,14 +147,11 @@ extension YHLoginMethodManager {
...
@@ -136,14 +147,11 @@ extension YHLoginMethodManager {
}
else
if
code
==
PNSCodeLoginControllerClickProtocol
{
}
else
if
code
==
PNSCodeLoginControllerClickProtocol
{
printLog
(
"点击了协议富文本"
)
printLog
(
"点击了协议富文本"
)
}
else
{
printLog
(
"获取登录Token失败"
)
}
}
}
}
}
}
}
func
createLoginUIModel
()
->
TXCustomModel
{
func
createLoginUIModel
()
->
TXCustomModel
{
...
@@ -198,7 +206,7 @@ extension YHLoginMethodManager {
...
@@ -198,7 +206,7 @@ extension YHLoginMethodManager {
model
.
loginBtnBgImgs
=
imgArr
model
.
loginBtnBgImgs
=
imgArr
// 创建视频底图View
// 创建视频底图View
let
videoBgView
=
YH
Auto
LoginView
(
frame
:
UIScreen
.
main
.
bounds
)
let
videoBgView
=
YH
OneKey
LoginView
(
frame
:
UIScreen
.
main
.
bounds
)
videoBgView
.
closeBlock
=
{
videoBgView
.
closeBlock
=
{
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
TXCommonHandler
.
sharedInstance
()
.
cancelLoginVC
(
animated
:
true
)
}
}
...
...
galaxy/galaxy/Classes/Modules/AutoLogin(一键登录)/V/YH
Auto
LoginView.swift
→
galaxy/galaxy/Classes/Modules/AutoLogin(一键登录)/V/YH
OneKey
LoginView.swift
View file @
389a4796
//
//
// YH
Auto
LoginView.swift
// YH
OneKey
LoginView.swift
// galaxy
// galaxy
//
//
// Created by edy on 2024/5/28.
// Created by edy on 2024/5/28.
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
import
UIKit
import
UIKit
import
AVFoundation
import
AVFoundation
class
YH
Auto
LoginView
:
UIView
{
class
YH
OneKey
LoginView
:
UIView
{
var
closeBlock
:(()
->
())?
var
closeBlock
:(()
->
())?
var
changeLoginBlock
:(()
->
())?
var
changeLoginBlock
:(()
->
())?
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHKEventViewController.swift
View file @
389a4796
...
@@ -140,7 +140,7 @@ extension YHHKEventViewController {
...
@@ -140,7 +140,7 @@ extension YHHKEventViewController {
YHShareManager
.
shared
.
sendLinkContent
(
"一图看清香港办事"
,
""
,
UIImage
(
named
:
"AppIcon"
)
??
UIImage
(),
link
:
urlString
)
YHShareManager
.
shared
.
sendLinkContent
(
"一图看清香港办事"
,
""
,
UIImage
(
named
:
"AppIcon"
)
??
UIImage
(),
link
:
urlString
)
}
}
}
else
{
}
else
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
389a4796
...
@@ -255,7 +255,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
...
@@ -255,7 +255,7 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
if
YHLoginManager
.
shared
.
isLogin
()
{
if
YHLoginManager
.
shared
.
isLogin
()
{
return
true
return
true
}
else
{
}
else
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
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
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
View file @
389a4796
...
@@ -80,7 +80,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
...
@@ -80,7 +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
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
return
}
}
if
flag
{
if
flag
{
...
@@ -109,7 +109,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
...
@@ -109,7 +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
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
return
}
}
if
flag
{
if
flag
{
...
@@ -240,7 +240,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
...
@@ -240,7 +240,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
task
.
resume
()
task
.
resume
()
}
}
}
else
{
}
else
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeCollectionViewCell.swift
View file @
389a4796
...
@@ -247,7 +247,7 @@ extension YHHomeCollectionViewCell {
...
@@ -247,7 +247,7 @@ extension YHHomeCollectionViewCell {
}
}
}
}
}
else
{
}
else
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHMyViewController.swift
View file @
389a4796
...
@@ -155,7 +155,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
...
@@ -155,7 +155,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
func
checkLogin
()
->
Bool
{
func
checkLogin
()
->
Bool
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
false
return
false
}
}
return
true
return
true
...
@@ -275,7 +275,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
...
@@ -275,7 +275,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
//#endif
//#endif
if
!
checkLogin
()
{
if
!
checkLogin
()
{
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
return
}
}
...
...
galaxy/galaxy/Classes/Tools/VideoPlay/YHVideoPlayerVC.swift
View file @
389a4796
...
@@ -139,7 +139,7 @@ class YHVideoPlayerVC: YHBaseViewController {
...
@@ -139,7 +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
()
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
return
}
}
if
flag
{
if
flag
{
...
@@ -169,7 +169,7 @@ class YHVideoPlayerVC: YHBaseViewController {
...
@@ -169,7 +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
()
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
return
}
}
if
flag
{
if
flag
{
...
@@ -262,7 +262,7 @@ extension YHVideoPlayerVC {
...
@@ -262,7 +262,7 @@ extension YHVideoPlayerVC {
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
self
.
player
.
pause
()
self
.
player
.
pause
()
YH
LoginMethodManager
.
shared
.
auto
Login
()
YH
OneKeyLoginManager
.
shared
.
oneKey
Login
()
return
return
}
}
...
...
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