layui token 过期 重新登陆
生活随笔
收集整理的這篇文章主要介紹了
layui token 过期 重新登陆
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這個方法你要全局設置 //jquery全局配置 $.ajaxSetup({ cache:?false, crossDomain:?true,?? headers?:{'Authorization':token}, complete:?function?(xhr)?{ console.log(xhr) if(xhr.responseJSON&&xhr.responseJSON.status==401)?{ console.log(xhr.responseJSON); layer.alert('權限不足,請重新登陸',?{ icon:?5, title:?"提示" },function()?{ window.parent.location.reload();?//刷新父頁面 window.parent.location.href="./index.html"; }); } } }); 效果
?
?
?
點擊確定后跳轉到登陸頁?
?
轉載于:https://www.cnblogs.com/guangzhou11/p/11535872.html
總結
以上是生活随笔為你收集整理的layui token 过期 重新登陆的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python(3) 进制转换
- 下一篇: 组件通信 Provideinject