This commit is contained in:
parent
efc819d0b7
commit
2f4c95d8a2
26
commont.js
26
commont.js
|
@ -178,19 +178,23 @@ function getCookie(e) {
|
||||||
// 遍历cookie数组并处理每个cookie
|
// 遍历cookie数组并处理每个cookie
|
||||||
for (var i = 0; i < cookieArray.length; i++) {
|
for (var i = 0; i < cookieArray.length; i++) {
|
||||||
// 使用trim()方法去除前后的空格
|
// 使用trim()方法去除前后的空格
|
||||||
var cookiePair = cookieArray[i]?.split("=");
|
|
||||||
var cookieName = cookiePair[0]?.trim();
|
|
||||||
var cookieValue = cookiePair[1]?.trim();
|
|
||||||
|
|
||||||
// 如果你只对某个特定的cookie感兴趣,可以添加条件判断
|
var cookiePair = cookieArray[i].split("=");
|
||||||
if (cookieName === e) {
|
if(cookiePair.length>1){
|
||||||
find=true;
|
var cookieName = cookiePair[0].trim();
|
||||||
r(cookieValue);
|
var cookieValue = cookiePair[1].trim();
|
||||||
}
|
// 如果你只对某个特定的cookie感兴趣,可以添加条件判断
|
||||||
if(i==cookieArray.length-1){
|
if (cookieName === e) {
|
||||||
if(!find){
|
find=true;
|
||||||
r(false);
|
r(cookieValue);
|
||||||
}
|
}
|
||||||
|
if(i==cookieArray.length-1){
|
||||||
|
if(!find){
|
||||||
|
r(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
r(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue