ajax全局配置

$.ajaxSetup({
    complete: function(xhr) {
        console.log(xhr)
        /*if(xhr.responseJSON.code == 401){
            parent.location.href = baseURL + 'login.html';
        }*/
        if(JSON.parse(xhr.responseText).code == 1){
        	location.href = "/front/user/login/toLoginPage.html";
        }
    }
});

該配置需要引入纔有用

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章