Vue project routing authorization (single routing)

beforeEnter(to,from,next){
            if(sessionStorage.getItem("token")){
                next()
            }else {
               alert("请先登录");
               next('/')
            }
        },

 

Guess you like

Origin blog.csdn.net/qq_37430247/article/details/112764641