var token = '123456';
that.$myHttp({
url: 'back/base/checkToken?admin_id=' + admin_id,
method: 'get',
headers: {Authorization: token},
}).then(function (res) {
if(res.data.code==1){console.log('登录成功!')}
if (res.data.code == 9) {
that.$message.error('请登录');
that.$router.push({name: 'login'})
}
});
vue 中axios的header请求,并携带token
最新推荐文章于 2024-07-12 04:28:48 发布