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.
|
|
|
import {createRouter, createWebHashHistory} from 'vue-router';
|
|
|
|
import {getStaff} from "../uilts/storage";
|
|
|
|
|
|
|
|
const routes: any = [
|
|
|
|
{ path: '/', redirect: '/Login'},
|
|
|
|
{ path: '/Login', component: () => import('../components/Login.vue') },
|
|
|
|
{ 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'
|
|
|
|
})
|
|
|
|
router.beforeEach((to,form,next)=>{
|
|
|
|
if (getStaff('login_staff')){
|
|
|
|
next()
|
|
|
|
}else {
|
|
|
|
if (to.path =="/Login"){
|
|
|
|
next()
|
|
|
|
}else {
|
|
|
|
next('/Login')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
router.afterEach((to,form,next)=>{
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
export default router;
|