fix(api): 引入 TextDecoder(gbk) 解决腾讯接口中文乱码,并在前端表单锁定币种联动字段

This commit is contained in:
2026-04-28 13:10:59 +08:00
parent ea57b4629a
commit 80029817a9
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ export async function syncAllStockPrices() {
try {
const tCode = getTencentSymbol(asset);
const response = await fetch(`https://qt.gtimg.cn/q=${tCode}`, { cache: 'no-store' });
const text = await response.text();
const arrayBuffer = await response.arrayBuffer();
const decoder = new TextDecoder('gbk');
const text = decoder.decode(arrayBuffer);
const match = text.match(/="([^"]+)"/);
if (match && match[1]) {