Recently, I encountered a permission management system. Since the permission management system is inconsistent with the original system style, a new window will be opened. The problem arises. After the admin logs out, the permission management window is not closed. After other ordinary users log in, they can still operate the permission management window.
Simplified problem: When the admin logs out, or when main.html is closed, all new windows that are opened are closed together. The problem is solved
Just look at the code: