refactor: AES 请求体改用 SimApiOneFieldRequest 序列化,去掉手拼字符串
- aesQuery/aesSignQuery:{"data":"..."} 手拼 → SimApiOneFieldRequest<String>
经 SimApiUtil.json 序列化(对齐 C# new SimApiOneFieldRequest<string>{...})
- SimApiOneFieldRequest<T> 恢复带参构造(构造请求用)
This commit is contained in:
@@ -86,7 +86,7 @@ public open class SimApiHttpClient {
|
||||
target = "${target}?${name}=${appId}"
|
||||
}
|
||||
let encrypted = aesEncrypt(body)
|
||||
let req = "{\"data\":\"${encrypted}\"}"
|
||||
let req = SimApiUtil.json(Some(SimApiOneFieldRequest<String>(encrypted)))
|
||||
return query<T>(target, req)
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public open class SimApiHttpClient {
|
||||
*/
|
||||
public func aesSignQuery<T>(url: String, body: String, queries!: HashMap<String, String> = HashMap<String, String>()): T {
|
||||
let encrypted = aesEncrypt(body)
|
||||
let req = "{\"data\":\"${encrypted}\"}"
|
||||
let req = SimApiUtil.json(Some(SimApiOneFieldRequest<String>(encrypted)))
|
||||
return signQuery<T>(url, body: req, queries: queries)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user