layui token 过期 重新登陆
生活随笔
收集整理的這篇文章主要介紹了
layui token 过期 重新登陆
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
這個(gè)方法你要全局設(shè)置 //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('權(quán)限不足,請(qǐng)重新登陸',?{ icon:?5, title:?"提示" },function()?{ window.parent.location.reload();?//刷新父頁(yè)面 window.parent.location.href="./index.html"; }); } } }); 效果
?
?
?
點(diǎn)擊確定后跳轉(zhuǎn)到登陸頁(yè)?
?
轉(zhuǎn)載于:https://www.cnblogs.com/guangzhou11/p/11535872.html
總結(jié)
以上是生活随笔為你收集整理的layui token 过期 重新登陆的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Python(3) 进制转换
- 下一篇: 组件通信 Provideinject