import router from '@/router'
import store from '@/store'

const blackList = ['/index/emr', '/index/diagnosis', '/index/dialectical', '/index/prescribing', '/index/physical'] // 白名单列表 , 

router.beforeEach((to, from, next) => {

    if (blackList.indexOf(to.path) !== -1) {
        // 验证是否有选择病人
        if (!sessionStorage.getItem("patiensInfo")) {
            console.log('当前尚未选择病人')
            next('/index/todaypatients')
        } else {
            next()
        }

    } else {
        next()
    }
})