优化首页的下拉刷新、数据排序、绑定后刷新
This commit is contained in:
33
node_modules/axios/lib/helpers/cookies.js
generated
vendored
33
node_modules/axios/lib/helpers/cookies.js
generated
vendored
@ -5,27 +5,38 @@ export default platform.hasStandardBrowserEnv ?
|
||||
|
||||
// Standard browser envs support document.cookie
|
||||
{
|
||||
write(name, value, expires, path, domain, secure) {
|
||||
const cookie = [name + '=' + encodeURIComponent(value)];
|
||||
write(name, value, expires, path, domain, secure, sameSite) {
|
||||
if (typeof document === 'undefined') return;
|
||||
|
||||
utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
||||
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
||||
|
||||
utils.isString(path) && cookie.push('path=' + path);
|
||||
|
||||
utils.isString(domain) && cookie.push('domain=' + domain);
|
||||
|
||||
secure === true && cookie.push('secure');
|
||||
if (utils.isNumber(expires)) {
|
||||
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
||||
}
|
||||
if (utils.isString(path)) {
|
||||
cookie.push(`path=${path}`);
|
||||
}
|
||||
if (utils.isString(domain)) {
|
||||
cookie.push(`domain=${domain}`);
|
||||
}
|
||||
if (secure === true) {
|
||||
cookie.push('secure');
|
||||
}
|
||||
if (utils.isString(sameSite)) {
|
||||
cookie.push(`SameSite=${sameSite}`);
|
||||
}
|
||||
|
||||
document.cookie = cookie.join('; ');
|
||||
},
|
||||
|
||||
read(name) {
|
||||
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
||||
return (match ? decodeURIComponent(match[3]) : null);
|
||||
if (typeof document === 'undefined') return null;
|
||||
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
||||
return match ? decodeURIComponent(match[1]) : null;
|
||||
},
|
||||
|
||||
remove(name) {
|
||||
this.write(name, '', Date.now() - 86400000);
|
||||
this.write(name, '', Date.now() - 86400000, '/');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user