You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

3 years ago
import {createRouter, createWebHashHistory} from 'vue-router';
3 years ago
import {getStaff} from "../uilts/storage";
3 years ago
const routes: any = [
3 years ago
{ path: '/', redirect: '/Login'},
{ path: '/Login', component: () => import('../components/Login.vue') },
3 years ago
{ path: '/MicrowaveRadiation', component: () => import('../components/MicrowaveRadiation.vue') },
{ path: '/RamanLidar', component: () => import('../components/RamanLidar.vue') },
{ path: '/SynergyEvaluation', component: () => import('../components/SynergyEvaluation.vue') },
{ path: '/DecisionSupport', component: () => import('../components/DecisionSupport.vue') },
{ path: '/SystemManagement', component: () => import('../components/SystemManagement.vue') }
];
const router = createRouter({
history: createWebHashHistory(),
routes,
linkActiveClass: 'active'
})
3 years ago
router.beforeEach((to,form,next)=>{
if (getStaff('login_staff')){
next()
}else {
if (to.path =="/Login"){
next()
}else {
next('/Login')
}
}
})
router.afterEach((to,form,next)=>{
})
3 years ago
export default router;