Solve the problem of iframe layer nesting in layui login

Solve the problem of iframe layer nesting in layui login

<script>
    if(window != top){
    
    
        top.location.href=location.href;
    };
</script>

In the iframe template of layui, the page is introduced by iframe, so the page redirected on the child (iframe) page is still displayed in the inline frame instead of the parent page; top.location.href (
outermost page jump), or use parent.location.href to jump to the previous layer (wrapped iframe) page

Guess you like

Origin blog.csdn.net/qq_46524280/article/details/131170937