替换获取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

@ -136,8 +136,8 @@ function formatCookie(headers) {
pt_pin = pt_pin.substring(pt_pin.indexOf("=") + 1, pt_pin.indexOf(";"))
const cookie1 = "pt_key=" + pt_key + ";pt_pin=" + pt_pin + ";";
$.UserName = decodeURIComponent(cookie1.match(/pt_pin=(.+?);/) && cookie1.match(/pt_pin=(.+?);/)[1])
$.log(`京东用户:${$.UserName} Cookie获取成功(有效期:${headers['strict-transport-security'].substring("max-age=7776000".indexOf('=') + 1, "max-age=7776000".length)}秒)cookie如下`);
$.UserName = decodeURIComponent(cookie1.match(/pt_pin=([^; ]+)(?=;?)/) && cookie1.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.log(`京东用户:${$.UserName} Cookie获取成功cookie如下`);
$.log(`\n${cookie1}\n`);
resolve()
})