替换获取pt_pin的正则,解决部分cookie填写不规范获取用户名为null的情况

This commit is contained in:
lxk0301
2021-03-24 15:27:58 +08:00
parent 550d6f8e8f
commit 746afb7983
95 changed files with 99 additions and 3720 deletions

View File

@@ -69,7 +69,7 @@ if ($.isNode()) {
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1])
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
@@ -102,7 +102,7 @@ if ($.isNode()) {
}
console.log(`\n参加作者的团\n`);
await joinLeaderTuan();//参团
$.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1])
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
console.log(`\n账号内部相互进团\n`);
for (let item of $.tuanIds) {
console.log(`${$.UserName} 去参加团 ${item}\n`);