fix a bug

This commit is contained in:
2026-09-05 13:09:39 +08:00
parent f928dd5c68
commit 6d9f9a5468
13 changed files with 805 additions and 107 deletions

View File

@@ -171,15 +171,19 @@ enum ImitationAssessor {
}
body.append(Data("--\(boundary)--\r\n".utf8))
var headers = [
"Accept": "application/json",
"Content-Type": "multipart/form-data; boundary=\(boundary)",
]
if !AppConfig.authToken.isEmpty {
headers["Authorization"] = "Bearer \(AppConfig.authToken)"
}
let result = try await HTTPClient.execute(
baseURL: AppConfig.serverBaseURL,
path: "api/v1/dub-shares",
method: "POST",
timeout: 120,
headers: [
"Accept": "application/json",
"Content-Type": "multipart/form-data; boundary=\(boundary)",
],
headers: headers,
body: body
)
guard (200...299).contains(result.statusCode) else {