当登录session失效时,避免iframe子页面出现登录页

解决方法如下:

<head>
<script>
     /**登陆判断是否是子页面跳转到登录页,如果是子页面,则定位到顶层父级页面登录*/
    if (window.top != null && window.top.document.URL != document.URL){
        window.top.location= document.URL;
    }
</script>
</head>

在登录页的中添加上面js代码即可。

发布了14 篇原创文章 · 获赞 2 · 访问量 799

猜你喜欢

转载自blog.csdn.net/breakaway_01/article/details/103430718