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

This commit is contained in:
lxk0301
2021-03-24 15:27:58 +08:00
parent 089f37160f
commit 3e112ef7bb
95 changed files with 99 additions and 3720 deletions

View File

@@ -52,7 +52,7 @@ function GetCookie() {
var CV = $request.headers["Cookie"] || $request.headers["cookie"];
if (CV.match(/(pt_key=.+?pt_pin=|pt_pin=.+?pt_key=)/)) {
var CookieValue = CV.match(/pt_key=.+?;/) + CV.match(/pt_pin=.+?;/);
var UserName = CookieValue.match(/pt_pin=(.+?);/)[1];
var UserName = CookieValue.match(/pt_pin=([^; ]+)(?=;?)/)[1];
var DecodeName = decodeURIComponent(UserName);
var CookiesData = getCache();
var updateCookiesData = [...CookiesData];
@@ -62,7 +62,7 @@ function GetCookie() {
var ck = item.cookie;
var Account = ck
? ck.match(/pt_pin=.+?;/)
? ck.match(/pt_pin=(.+?);/)[1]
? ck.match(/pt_pin=([^; ]+)(?=;?)/)[1]
: null
: null;
const verify = UserName === Account;