/statistic/appdatacollection/saveAppData 接口添加完毕

This commit is contained in:
bluesea 2024-04-12 18:19:50 +08:00
parent 35621dd1c3
commit 5ebfe28e24
3 changed files with 11 additions and 10 deletions

View File

@ -33,13 +33,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
configureFireBase()
do {
try AVAudioSession.sharedInstance().setActive(true)
try AVAudioSession.sharedInstance().setCategory(.playback,options: .allowAirPlay)
}
catch {
print("err: set audiosession:\(error)")
}
// do {
// try AVAudioSession.sharedInstance().setActive(true)
// try AVAudioSession.sharedInstance().setCategory(.playback,options: .allowAirPlay)
// }
// catch {
// print("err: set audiosession:\(error)")
// }
SVProgressHUD.setDefaultStyle(.dark)

View File

@ -29,11 +29,12 @@ class ZNetUtil: NSObject {
var request = URLRequest(url: url)
request.httpMethod = "POST"
let comParams = getComParams()
var nparams = params.merging(comParams) { va, ke in
let nparams = params.merging(comParams) { va, ke in
}
request.httpBody = try? JSONSerialization.data(withJSONObject: nparams, options: [])
let bodyData = try? JSONSerialization.data(withJSONObject: nparams, options: [])
request.httpBody = bodyData
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let dataTask = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error:", error)