tokenCook: (name, value, time) => { // 设置cookie
var exp = new Date()
exp.setTime(exp.getTime() + time * 60 * 24 * 60 * 1000) // 这里的time就是天数 escape()编码
document.cookie = name + '=' + escape(value) + ';expires=' + exp.toGMTString()
}
getcookie: (name) => {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
// 读取cookie unescape() 解码操作
if (arr != null) return unescape(arr[2]); return null;
}
// 删除cookie
function deleteCookie(name){
var date=new Date();
date.setTime(date.getTime()-10000);
document.cookie=name+"=v; expires="+date.toGMTString();
}