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
705dba9e
Commit
705dba9e
authored
Apr 15, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// deviceToken 参数
parent
58a5ab04
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
11 deletions
+89
-11
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-0
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+1
-1
YHCodeSueecssViewController.swift
...ses/Modules/Login(登录)/C/YHCodeSueecssViewController.swift
+26
-8
YHUserModel.swift
galaxy/galaxy/Classes/Modules/Login(登录)/M/YHUserModel.swift
+3
-1
YHLoginManager.swift
...axy/Classes/Modules/Login(登录)/Server/YHLoginManager.swift
+2
-0
YHTestViewController.swift
...axy/Classes/Modules/Mine(我的)/C/YHTestViewController.swift
+50
-0
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+3
-1
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
705dba9e
...
...
@@ -18,6 +18,7 @@
04174D5D2BCD43F9000BA46D
/* YHInformationFillCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D582BCD43F9000BA46D
/* YHInformationFillCell.swift */
;
};
04174D5F2BCD44A5000BA46D
/* YHMsgListModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D5E2BCD44A5000BA46D
/* YHMsgListModel.swift */
;
};
04174D622BCD45E5000BA46D
/* YHMsgViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D612BCD45E5000BA46D
/* YHMsgViewModel.swift */
;
};
04174D642BCD52BD000BA46D
/* YHTestViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D632BCD52BD000BA46D
/* YHTestViewController.swift */
;
};
0425E63D2BA9345200A5E763
/* YHSchemeTableViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
;
};
0425E6402BA9357D00A5E763
/* YHScemeItemModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
;
};
0425E6422BA95B1B00A5E763
/* YHSchemeTableFooterView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
;
};
...
...
@@ -460,6 +461,7 @@
04174D582BCD43F9000BA46D
/* YHInformationFillCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHInformationFillCell.swift
;
sourceTree
=
"<group>"
;
};
04174D5E2BCD44A5000BA46D
/* YHMsgListModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
YHMsgListModel.swift
;
path
=
../../../../../../../Desktop/YHMsgListModel.swift
;
sourceTree
=
"<group>"
;
};
04174D612BCD45E5000BA46D
/* YHMsgViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
YHMsgViewModel.swift
;
path
=
../../../../../../../Desktop/YHMsgViewModel.swift
;
sourceTree
=
"<group>"
;
};
04174D632BCD52BD000BA46D
/* YHTestViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHTestViewController.swift
;
sourceTree
=
"<group>"
;
};
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableViewCell.swift
;
sourceTree
=
"<group>"
;
};
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHScemeItemModel.swift
;
sourceTree
=
"<group>"
;
};
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableFooterView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1955,6 +1957,7 @@
0414BDAC2BC7F02C00225367
/* YHMyNotifySettingVC.swift */
,
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
,
048B2A492BC7D9DC00A93BF0
/* YHMyLikeViewController.swift */
,
04174D632BCD52BD000BA46D
/* YHTestViewController.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
...
...
@@ -2592,6 +2595,7 @@
045EEEB92B9F171A0022A143
/* YHWorkMessageSelectTableViewCell.swift in Sources */
,
044E1E812BC3BBC200A3B4AF
/* YHSearchInfomationVC.swift in Sources */
,
04A7BD0F2BA41C9800BD35A2
/* YHMyDocumentsModel.swift in Sources */
,
04174D642BCD52BD000BA46D
/* YHTestViewController.swift in Sources */
,
A5ACE92E2B4564F7002C94D2
/* YHValidateCodeInputView.swift in Sources */
,
045EEED82B9F171A0022A143
/* YHQuestionInfo.swift in Sources */
,
A5ACE94E2B4564F7002C94D2
/* AlignedCollectionViewFlowLayout.swift in Sources */
,
...
...
galaxy/galaxy/Applegate(JPush).swift
View file @
705dba9e
...
...
@@ -41,7 +41,7 @@ extension AppDelegate: JPUSHRegisterDelegate {
let
deviceTokenStr
=
deviceToken
.
map
{
String
(
format
:
"%02.2hhx"
,
arguments
:
[
$0
])
}
.
joined
()
print
(
"deviceToken:
\(
deviceTokenStr
)
"
)
JPUSHService
.
registerDeviceToken
(
deviceToken
)
YHLoginManager
.
shared
.
userModel
?
.
deviceToken
=
deviceTokenStr
YHLoginManager
.
shared
.
deviceTokenModel
.
deviceToken
=
deviceTokenStr
}
//获取token 失败
func
application
(
_
application
:
UIApplication
,
didFailToRegisterForRemoteNotificationsWithError
error
:
Error
)
{
//可选
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/C/YHCodeSueecssViewController.swift
View file @
705dba9e
...
...
@@ -96,15 +96,19 @@ class YHCodeSueecssViewController: YHBaseViewController {
guard
let
self
=
self
else
{
return
}
if
let
phone
=
self
.
phoneNumber
{
self
.
viewModel
?
.
login
(
phone
:
phone
,
code
:
code
,
callBackBlock
:
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
==
false
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
else
{
YHHUD
.
flash
(
message
:
"登录成功"
)
self
.
dismiss
(
animated
:
true
)
// 登录接口需要加一个deviceToken参数
YHHUD
.
show
(
.
progress
(
message
:
"登录中..."
))
if
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
.
isEmpty
{
JPUSHService
.
registrationIDCompletionHandler
{
resCode
,
registrationID
in
YHHUD
.
hide
()
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
=
registrationID
??
""
self
.
requetLogin
(
phone
:
phone
,
code
:
code
)
}
})
}
else
{
self
.
requetLogin
(
phone
:
phone
,
code
:
code
)
}
}
else
{
printLog
(
"errror : 电话号码为空"
)
}
...
...
@@ -163,6 +167,20 @@ class YHCodeSueecssViewController: YHBaseViewController {
}
func
requetLogin
(
phone
:
String
,
code
:
String
)
{
YHHUD
.
show
(
.
progress
(
message
:
"登录中..."
))
self
.
viewModel
?
.
login
(
phone
:
phone
,
code
:
code
,
callBackBlock
:
{[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
success
==
false
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
""
)
}
else
{
YHHUD
.
flash
(
message
:
"登录成功"
)
self
.
dismiss
(
animated
:
true
)
}
})
}
func
startTime
()
{
getCodeLabel
.
isHidden
=
false
getCodeButton
.
isHidden
=
true
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/M/YHUserModel.swift
View file @
705dba9e
...
...
@@ -17,8 +17,10 @@ struct YHUserModel: SmartCodable {
var
sex
:
Int
?
var
token
:
String
?
}
struct
YHDeviceTokenModel
{
var
deviceToken
:
String
=
""
var
pushUserId
:
String
=
""
var
registerId
:
String
=
""
}
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/Server/YHLoginManager.swift
View file @
705dba9e
...
...
@@ -12,6 +12,8 @@ class YHLoginManager: NSObject {
static
let
shared
=
YHLoginManager
()
var
userModel
:
YHUserModel
?
var
deviceTokenModel
:
YHDeviceTokenModel
=
YHDeviceTokenModel
()
private
override
init
()
{}
func
isLogin
()
->
Bool
{
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/C/YHTestViewController.swift
0 → 100644
View file @
705dba9e
//
// YHTestViewController.swift
// galaxy
//
// Created by edy on 2024/4/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHTestViewController
:
YHBaseViewController
{
lazy
var
nameLabel
:
UILabel
=
{
let
nameLabel
=
UILabel
()
nameLabel
.
textColor
=
UIColor
(
hex
:
0x121A26
)
nameLabel
.
textAlignment
=
.
left
nameLabel
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
nameLabel
.
numberOfLines
=
0
return
nameLabel
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
white
view
.
addSubview
(
nameLabel
)
nameLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalToSuperview
()
}
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
JPUSHService
.
registrationIDCompletionHandler
{
resCode
,
registrationID
in
YHHUD
.
hide
()
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
=
registrationID
??
""
var
info
=
"deviceToken:
\n
"
+
(
YHLoginManager
.
shared
.
deviceTokenModel
.
deviceToken
)
info
+=
"
\n
registerId:
\n
"
+
(
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
)
DispatchQueue
.
main
.
async
{
self
.
nameLabel
.
text
=
info
}
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
705dba9e
...
...
@@ -90,7 +90,9 @@ class YHNetRequest: NSObject {
requestHeader
.
add
(
name
:
"sign"
,
value
:
sign
)
requestHeader
.
add
(
name
:
"token"
,
value
:
YHLoginManager
.
shared
.
userModel
?
.
token
??
"-"
)
requestHeader
.
add
(
name
:
"device-id"
,
value
:
YHLoginManager
.
shared
.
userModel
?
.
registerId
??
""
)
if
!
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
.
isEmpty
{
requestHeader
.
add
(
name
:
"device-id"
,
value
:
YHLoginManager
.
shared
.
deviceTokenModel
.
registerId
)
}
// requestHeader.add(name: "token", value: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTI0NjA1NzQsImkiOjk4OTcwNDI5NjA3NzI0OSwidSI6IumTtuays-mbhuWboiIsInIiOiJzdXBlcl9hcHAifQ.jyBpXSii6nlRIITdOya3GQa5eb5G42Jh9nj39Cncwl8")
...
...
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