Vue router gets vuex state

how can I get the state of vuex in vue-router?

router.beforeEach I want to make login judgment in this. How can I get the user information in state?

Oct.27,2021

your store file:

const store = new Vuex.Store({...})
export default store

your routing file:

import store from 'store'

router.beforeEach((to, from, next) => {
    console.log(store.state.user_info)
})
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-1b37749-2b3fb.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-1b37749-2b3fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?