修复虎牙手机号登录并统一部署项目名

This commit is contained in:
yml2213
2026-08-31 16:11:08 +08:00
parent 09ab80e062
commit 76b14b69b7
10 changed files with 223 additions and 20 deletions
+8 -2
View File
@@ -6,12 +6,18 @@ const path = require('path');
const https = require('https');
globalThis.window = globalThis;
const stateDir = process.argv[2] || '.';
let _deviceOverrides = null;
try { _deviceOverrides = JSON.parse(fs.readFileSync(process.argv[3] || '', 'utf8')); } catch (e) {}
// Prefer an explicitly supplied JSON path; otherwise use the device hint that
// get_huya_sdid writes into the per-account state directory.
try {
const hintPath = process.argv[3] && process.argv[3].endsWith('.json')
? process.argv[3] : path.join(stateDir, 'device.json');
_deviceOverrides = JSON.parse(fs.readFileSync(hintPath, 'utf8'));
} catch (e) {}
require(path.join(__dirname, 'env.js')).makeEnv(_deviceOverrides);
// ---- localStorage 持久化(设备稳定性) ----
const stateDir = process.argv[2] || '.';
try { fs.mkdirSync(stateDir, {recursive: true}); } catch (e) {}
const lsFile = path.join(stateDir, 'localstorage.json');
let _ls = {};