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); - });