gx
chenyc
2025-07-10 bb6e8dab96d91b59281ea938130accdc32cab918
src/router/index.ts
@@ -36,18 +36,22 @@
        document.title = to.meta.title
    }
    // 看看有没有toke
    const token = Session.get('token');
   console.log(!token)
    const token = Session.get('token')
    console.log(!token)
    if (to.path === '/login') {
      next();
   }else{
        next()
    } else {
        if (!token){
            next('/login');
        }else{
            next('/login')
        } else {
            console.log('---')
            await userInfo.setPatientApi()
            next();
            if (to.path === '/'){
                await userInfo.setPatientApi()
                await userInfo.setPatientApi()
            }
            next()
        }
    }
})