first commit

This commit is contained in:
2021-01-25 16:19:15 +08:00
parent eff288414d
commit 722ab517b0
11 changed files with 242 additions and 18 deletions

27
src/router/index.js Normal file
View File

@@ -0,0 +1,27 @@
import Router from "vue-router"
import store from "@/store/index.js"
let router = new Router({
routes:[
{
path:"/",
component:() => import("../views/index.vue")
},
{
path:"/login",
component:() => import("@/views/login.vue")
}
]
})
router.beforeEach((to, from, next) => {
console.log(to.path,store.state.quanxian)
if(store.state.quanxian){
next()
}else if(to.path != "/login"){
router.push("/login")
}else{
next()
}
})
export default router