refactor(openai): 重新实现请求加密 XML 序列化的方式

This commit is contained in:
Fu Diwei
2022-11-21 15:56:59 +08:00
parent 154eea7ac2
commit 9741b34642
40 changed files with 312 additions and 136 deletions

View File

@@ -112,7 +112,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI
using var fileContent = new ByteArrayContent(request.FileBytes ?? Array.Empty<byte>());
using var paramContent = new StringContent(
Utilities.WxMsgCryptor.AESEncrypt(
plainText: Utilities.XmlUtility.Serialize(request),
plainText: Utilities.XmlUtility.ConvertFromJson(client.JsonSerializer.Serialize(request)),
encodingAESKey: client.Credentials.EncodingAESKey!,
appId: client.Credentials.AppId!
),