From 39db3e207c1efeea650f96a60eafcdcfd622ee0f Mon Sep 17 00:00:00 2001 From: "Cauchy.Ke" Date: Thu, 24 Feb 2022 16:44:51 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=87=87=E7=94=A8encodeURI=E6=9B=BF?= =?UTF-8?q?=E4=BB=A3escape?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/structure/cache.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/structure/cache.js b/src/core/structure/cache.js index dc6f78714..5f17bd630 100644 --- a/src/core/structure/cache.js +++ b/src/core/structure/cache.js @@ -47,7 +47,7 @@ BI.Cache = { }, addCookie: function (name, value, path, expiresHours) { - var cookieString = name + "=" + escape(value); + var cookieString = name + "=" + encodeURI(value); // 判断是否设置过期时间 if (expiresHours && expiresHours > 0) { var date = new Date(); @@ -62,7 +62,7 @@ BI.Cache = { }, getCookie: function (name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); - if (arr = document.cookie.match(reg)) {return unescape(arr[2]);} + if (arr = document.cookie.match(reg)) {return decodeURI(arr[2]);} return null; }, deleteCookie: function (name, path) { @@ -74,4 +74,4 @@ BI.Cache = { } document.cookie = cookieString; } -}; \ No newline at end of file +};