Skip to content

Commit

Permalink
修复 QQName API 编码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lc6464 committed Oct 5, 2023
1 parent a292f55 commit f55cc15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>x64</Platforms>
<Version>1.3.1.0</Version>
<Version>1.3.2.0</Version>
<Authors>LC</Authors>
<Copyright>Copyright © 2022-2023 LC. All rights reserved.</Copyright>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions Controllers/QQNameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ public QQNameController(ILogger<QQNameController> logger, IHttpClientFactory htt
hc.BaseAddress = new("https://users.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg");
try {
var start = DateTime.UtcNow;
var data = await hc.GetByteArrayAsync("?uins=" + qq).ConfigureAwait(false);
var result = await hc.GetStringAsync("?uins=" + qq).ConfigureAwait(false);
Response.Headers.Add("Server-Timing", $"g;desc=\"Get API\";dur={(DateTime.UtcNow - start).TotalMilliseconds}"); // Server Timing API
var result = Encoding.GetEncoding("GB18030").GetString(data); // Get 数据
Regex head = new(@$"portraitCallBack\(\{{""{qq}"":\[""http://qlogo\d\d?\.store\.qq\.com/qzone/{qq}/{qq}/100"",((\-)?\d{{1,8}},){{5}}""");

using var entry = _memoryCache.CreateEntry(cacheKey); // 创建内存缓存
Expand Down

0 comments on commit f55cc15

Please sign in to comment.