📅  最后修改于: 2022-03-11 15:02:23.136000             🧑  作者: Mango
function getCookie(cookie, name) {
const q = {}
cookie?.replace(/\s/g, '')
.split(';')
.map(i=>i.split('='))
.forEach(([key, value]) => {
q[key] = value
})
return q[name]??null;
}