获取cookie

xiaoxiao2021-03-01  36

function getCookie(sName) { let aCookie = document.cookie.split("; "); for (let i=0; i < aCookie.length; i++) { let aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } } export default{ mounted(){ let that=this; let timestamp = (new Date()).valueOf(); let randomNum = Math.ceil(Math.random() * 10); let authToken=getCookie("authToken"); if(authToken!='') {...}, }

 

转载请注明原文地址: https://www.6miu.com/read-4394371.html

最新回复(0)