在登录的时候保存token
window.sessionStorage.setItem('cat_token', res.data.token)
发起请求时带上token
function getInfo(url, params) {
const token = window.sessionStorage.getItem('cat_token')
axios.post(url, params, { headers: { Authorization: ` ${token}` } }).then((res) => {
console.log(res)
})
}