From f55cc15ee99b742630888a1aca5bc19a884d5e0b Mon Sep 17 00:00:00 2001
From: lc6464 <64722907+lc6464@users.noreply.github.com>
Date: Thu, 5 Oct 2023 21:01:54 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20QQName=20API=20=E7=BC=96?=
=?UTF-8?q?=E7=A0=81=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
API.csproj | 2 +-
Controllers/QQNameController.cs | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/API.csproj b/API.csproj
index 86544fb..99efbaf 100644
--- a/API.csproj
+++ b/API.csproj
@@ -4,7 +4,7 @@
enable
enable
x64
- 1.3.1.0
+ 1.3.2.0
LC
Copyright © 2022-2023 LC. All rights reserved.
diff --git a/Controllers/QQNameController.cs b/Controllers/QQNameController.cs
index 816afcc..7734c9b 100644
--- a/Controllers/QQNameController.cs
+++ b/Controllers/QQNameController.cs
@@ -36,9 +36,8 @@ public QQNameController(ILogger 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); // 创建内存缓存