global.js
414 Bytes
/**
* 全局引用js
* @author: feng.chen<feng.chen@yoho.cn>
* @date: 2017/03/15
*/
const $ = require('yoho-jquery');
const cookie = require('yoho-cookie');
// 初始化
// 注册ajaxError处理服务端401状态
$(document).ajaxError((event, xhr) => {
if (xhr.status === 401) {
cookie.remove('_UID');
cookie.remove('_TOKEN');
window.location.href = '/passport/login';
}
});