封装cookie cookie.jsconst cookies = { cookie: { // 设置cookie set: (name, value, day) => { const date = new Date(); date.setDate(date.getDate() + day); document.cookie = name + “=” + value + “;expires=” + date; }, // 获取cookie get: (key) => { var arr = document.cookie.split(“; “); for (var i = 0; i { cookie.set(name,”, -1) } }}
。。。。。。。。。。。。。
作者:Vam的金豆之路
篇幅有限更多请见扩展链接:http://www.mark-to-win.com/tutorial/50921.html