$.ajaxSetup(
{
headers: {
access_token: localStorage.getItem('access_token')
},
}
);
$(document).ajaxComplete(function (event, xhr, options) {
if (xhr.responseJSON.msg === 'token失效') {
layer.msg('登录超时,即将跳转至登录页。。。', {
icon: 2,
time: 2000
}, function () {
location.href = '../../pages/user/login.html';
});
}
});