From 407cf9644b364ebce54145e3965dcd4f3bf5374e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Sat, 16 Nov 2024 15:36:22 +0000 Subject: [PATCH] refactor: trim tokens --- app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 951c5a8..4d7d2f8 100644 --- a/app.js +++ b/app.js @@ -238,7 +238,8 @@ class AccountSession { async function loadTokens() { try { const tokens = await fs.readFile('tokens.txt', 'utf-8') - return tokens.split('\n').filter(Boolean) + // 移除空行和空格,引号 + return tokens.split('\n').filter(Boolean).map(token => token.trim().replace(/['"]+/g, '')) } catch (error) { console.log(`Failed to load tokens: ${error.message}`) throw error