/* * @Author: fxs bjnsfxs@163.com * @Date: 2024-08-20 14:32:43 * @LastEditors: fxs bjnsfxs@163.com * @LastEditTime: 2024-10-10 17:25:25 * @FilePath: \Game-Backstage-Management-System\src\router\login.ts * @Description: * */ import type {NavigationGuardNext, RouteLocationNormalized} from 'vue-router' import {getLoginState} from '@/utils/localStorage/localStorage' export default [ { path: '/login', name: 'Login', component: () => import('@/views/Login/LoginView.vue'), beforeEnter: ( _to: RouteLocationNormalized, _from: RouteLocationNormalized, next: NavigationGuardNext ) => { if (getLoginState()) { next('/') } else { next() } } } ]