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
8b40f780
Commit
8b40f780
authored
Jan 05, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加测试代码
parent
42030641
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
28 deletions
+28
-28
YHHomeViewController.swift
...axy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
+9
-1
YHHomePageViewModel.swift
...axy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
+0
-6
YHIntelligentServiceViewController.swift
...tService(智慧服务)/C/YHIntelligentServiceViewController.swift
+1
-1
YHNetRequest.swift
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
+18
-20
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
View file @
8b40f780
...
...
@@ -18,7 +18,6 @@ class YHHomeViewController: YHBaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
//1.UI
initView
()
...
...
@@ -26,6 +25,15 @@ class YHHomeViewController: YHBaseViewController {
requestData
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
//for test hjl
requestData
()
}
private
func
requestData
()
{
self
.
homeReqVM
.
getHomeConfig
()
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
View file @
8b40f780
...
...
@@ -20,12 +20,6 @@ extension YHHomePageViewModel {
func
getHomeConfig
()
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
homeConfigApi
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
)
{
json
,
code
in
//1. json字符串 转 对象
guard
let
model
=
NetBaseModel
.
deserialize
(
dict
:
json
)
else
{
print
(
"error....底层解析出错了..."
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(智慧服务)/C/YHIntelligentServiceViewController.swift
View file @
8b40f780
...
...
@@ -16,7 +16,7 @@ class YHIntelligentServiceViewController: YHBaseViewController {
initView
()
testModelParse
()
//
testModelParse()
}
func
initView
()
{
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHNetRequest.swift
View file @
8b40f780
...
...
@@ -104,19 +104,19 @@ class YHNetRequest: NSObject {
httpRequest
=
AF
.
request
(
self
.
url
!
,
method
:
self
.
requestType
,
parameters
:
self
.
params
,
encoding
:
URLEncoding
(
destination
:
.
queryString
),
headers
:
requestHeaders
,
interceptor
:
nil
,
requestModifier
:
nil
)
_
=
httpRequest
?
.
id
httpRequest
?
.
responseString
(
completionHandler
:
{
string
in
#if DEBUG
print
(
"
\n
网络请求已返回 string=
\(
string
)
"
)
#endif
self
.
completeHandle
(
string
:
string
)
})
httpRequest
?
.
responseString
(
completionHandler
:
{
string
in
#if DEBUG
print
(
"
\n
网络请求已返回 string=
\(
string
)
"
)
#endif
self
.
completeHandle
(
string
:
string
)
})
// httpRequest?.responseJSON(completionHandler: { string
in
//
#if DEBUG
// print("\n网络请求已返回 string=\(string
)")
//
#endif
//
})
//
// httpRequest?.responseJSON(completionHandler: { json
in
//
#if DEBUG
// print("\n网络请求已返回 string=\(json
)")
//
#endif
//
})
return
httpRequest
}
/// 请求response完成处理
...
...
@@ -154,14 +154,12 @@ class YHNetRequest: NSObject {
if
statusCode
==
200
{
guard
let
suclock
=
self
.
success
else
{
return
}
// guard JSONSerialization.isValidJSONObject(serverDict) == true else {
// let dittt = self.handleJsonObjectNullValue(serverDict)
// suclock(dittt as! [String : Any],statusCode)
// return
// }
// suclock(serverDict,statusCode)
// guard JSONSerialization.isValidJSONObject(serverDict) == true else {
// let dittt = self.handleJsonObjectNullValue(serverDict)
// suclock(dittt as! [String : Any],statusCode)
// return
// }
// suclock(serverDict,statusCode)
let
dittt
=
self
.
handleJsonObjectNullValue
(
serverDict
)
suclock
(
dittt
as!
[
String
:
Any
],
statusCode
)
...
...
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