尘叶心繁

解决前台无权访问跳转到登录页面

电脑版发表于:2019/9/10 10:35

如题

通过官网的API可知其中有一个全局拦截错误的事件

$(document).ajaxError(function(ajaxError,jqXHR) {  
    
    //jqXHR可直接获取错误的消息
    //其中jqXHR.stateInfo 可以获取错误访问的状态码
    
    $(".log").text("Triggered ajaxError handler." );
});


https://api.jquery.com/ajaxError/#ajaxError-handler

关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢