fix: split accounts by newline only
This commit is contained in:
@@ -28,13 +28,12 @@ try {
|
||||
//
|
||||
// 环境变量配置:
|
||||
// export dxxwhd="账号&密码" # 单账号
|
||||
// export dxxwhd="账号1&密码1@账号2&密码2" # 多账号用@分隔
|
||||
// export dxxwhd="账号1&密码1
|
||||
// 账号2&密码2" # 多账号也可用换行分隔
|
||||
// export dxxwhd="账号&密码&支付宝账号&姓名&socks5://127.0.0.1:7890" # 可选账号级 SOCKS5 代理
|
||||
// export dxxwhd=$'账号1&密码1&支付宝1&姓名1&socks5h://user:pass@host1:1080\n账号2&密码2&支付宝2&姓名2&socks5h://user:pass@host2:1080' # 多账号仅用换行分隔
|
||||
//
|
||||
// 账号字段:账号&密码&支付宝账号&姓名&socks5代理
|
||||
// - 支付宝账号/姓名/代理均可选;如果只想配置代理但不配置支付宝,可写:账号&密码&&&socks5://host:port
|
||||
// - 多账号只按换行分隔,不再按 @ 分隔,避免带密码 SOCKS5 里的 @ 被误拆账号
|
||||
// - 代理用户名/密码如果包含 &,仍需 URL 编码为 %26,因为 & 是账号字段分隔符
|
||||
// - 代理支持 socks5:// / socks5h://,可带认证:socks5h://user:pass@host:port
|
||||
// - 该账号配置代理后,登录、积分、文章、微剧/兑吧等所有 axios 请求均走该代理;未配置则使用本地网络
|
||||
//
|
||||
@@ -1428,13 +1427,11 @@ async function start() {
|
||||
console.log(`未找到环境变量 dxxwhd,请设置。格式: 账号&密码`);
|
||||
return;
|
||||
}
|
||||
if (dxxwhd.indexOf('@') > -1) {
|
||||
dxxwhdArr = dxxwhd.split('@');
|
||||
} else if (dxxwhd.indexOf('\n') > -1) {
|
||||
dxxwhdArr = dxxwhd.split('\n');
|
||||
} else {
|
||||
dxxwhdArr = [dxxwhd];
|
||||
}
|
||||
// 多账号仅按换行分隔;不再按 @ 分隔,避免 socks5://user:pass@host:port 被误拆。
|
||||
dxxwhdArr = dxxwhd
|
||||
.split(/\r?\n/)
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
console.log(`\n=================== 共找到 ${dxxwhdArr.length} 个账号 ===================`);
|
||||
console.log(`执行模式: ${ENABLE_CONCURRENT ? '并发模式 🚀' : '顺序模式 ⏭️'}`);
|
||||
|
||||
Reference in New Issue
Block a user