Commit 126c485b authored by louyuqi's avatar louyuqi

update

parent d6737c02
......@@ -2,13 +2,14 @@ import {createRouter, createWebHistory, RouterOptions} from 'vue-router'
import {routes} from "../config/menu";
import {getStore} from "../utils/userinfo";
// @ts-ignore
const userInfo = getStore('mining-manager')
const router=createRouter(<RouterOptions>{
history: createWebHistory(),
routes,
})
router.beforeEach((to,from,next)=>{
// console.log(to,from,'???')
const userInfo = getStore('mining-manager')
console.log(to,from,'???',userInfo)
if(to.path!=='/login'&&!userInfo?.token){
next({path:'/login'})
}else{
......
......@@ -22,11 +22,12 @@ const login = async () => {
token: getToken,
expire: '1d'
})
router.push('/user')
ElMessage({
message: "用户登陆成功",
type: "success"
})
router.push('/user')
console.log('?')
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment