Skip to content

Commit 02bd9b2

Browse files
committed
fix(microapp): 修复逻辑错误
1 parent 25e0dc6 commit 02bd9b2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
## 特性
1717

1818
- 基于 `Flurl.Http`
19-
- 支持 .NET Framework 4.6.2+、.NET Standard 2.0+、.NET Core 2.0+、.NET 5.0+ 多目标框架。
19+
- 支持 .NET Framework 4.6.2+、.NET Core 3.1+、.NET 5.0+ 多目标框架。
2020
- 支持 Windows / Linux / macOS 多平台部署。
2121
- 支持 `System.Text.Json`(默认)和 `Newtonsoft.Json` 两种序列化方式。
2222
- 强类型接口模型。

src/SKIT.FlurlHttpClient.ByteDance.MicroApp/Extensions/DouyinMicroAppClientExecuteLegacyAppsGameExtensions.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ private static T PreprocessRequest<T>(DouyinMicroAppClient client, ref T request
3131
{
3232
string json = client.JsonSerializer.Serialize(request);
3333
IDictionary<string, string> paramMap = new SortedDictionary<string, string>(Newtonsoft.Json.JsonConvert.DeserializeObject<IDictionary<string, string>>(json)!, StringComparer.Ordinal);
34-
foreach (var entry in paramMap)
34+
foreach (string key in paramMap.Keys.ToArray())
3535
{
36-
if (entry.Key == "mp_sig")
37-
paramMap.Remove(entry.Key);
38-
if (entry.Value is null)
39-
paramMap.Remove(entry.Key);
36+
if (key == "mp_sig")
37+
paramMap.Remove(key);
38+
else if (paramMap[key] is null)
39+
paramMap.Remove(key);
4040
}
4141

4242
string message = string.Join("&", paramMap.Select(e => $"{e.Key}={e.Value}"))

0 commit comments

Comments
 (0)