The navigation menu of ElementUI is not logged in to change the route

first of all, the navigation menu of ElementUI can be used normally.
now I"m going to make a login judgment. If you don"t log in, click "Security Center" and "Finance Center" in the navigation, and the interface will jump to the login screen

.

now the problem is that you can"t jump to the login interface
code is as follows. I hope you can solve the problem, or is there any other way

handleSelect(key, keyPath) {
    //console.log(key,keyPath)keykeyPath
    const token = Cookies.get("loginToken");//token
    if(key === "safety" || key === "financial"){//safetyfinancial
    
        if (!token || token == "") {

            this.$router.push({path: "/login"});

            console.log(this.$route.path)// "/login" 
        }
    }
}
Jul.19,2022

judging
pseudo code in route interception

router.beforeEach((to, from, next) => {
    if() {
            next({
                path: '/logIn'
            });    
    } else {
        next()
    }
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bdc855-31312.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bdc855-31312.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?