From a1db1e5842657fd9c67ebe9ada3cb2660cfaffdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E7=AE=80=E5=8D=95=E5=8D=95?= Date: Sun, 17 May 2026 08:04:19 +0200 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20node.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node.js | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 node.js diff --git a/node.js b/node.js deleted file mode 100644 index 4b4d37c..0000000 --- a/node.js +++ /dev/null @@ -1,26 +0,0 @@ -const https = require('https'); - -const jsonUrl = 'https://gittea.dev/Vibrantly/Try/raw/branch/master/x.json'; - -https.get(jsonUrl, (res) => { - let base64Data = ''; - res.on('data', (chunk) => { base64Data += chunk; }); - - res.on('end', () => { - // --- 核心解码逻辑 --- - // 直接使用 Buffer.from 指定 'base64' 编码进行还原 - const jsonString = Buffer.from(base64Data.trim(), 'base64').toString('utf-8'); - - // --- 自动解析并运行 --- - try { - const configData = JSON.parse(jsonString); - console.log("【自动转换并解析成功】:", configData); - - // 继续执行你的业务逻辑... - } catch (e) { - console.error("JSON 解析失败:", e); - } - }); - }).on("error", (err) => { - console.error("请求出错:", err.message); - });