cookie字符串中获取token
function getTokenByCookie(cookies_str) {
if (!cookies_str) return null
let cookies = cookies_str.split(';')
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i].trim().split('=')
if (cookie[0] == 'token') {
return cookie[1]
}
}
return null
}