保誠-保戶業務員媒合平台
Tomas
2022-01-19 22ee840d8c9a79e56609351fa67e6c2ac9f620bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { Middleware } from '@nuxt/types';
 
const errorRouteMiddleware: Middleware = (context) => {
  if (!context.route.name) {
    const isAdminLogin = context.store.getters['localStorage/isAdminLogin'];
    if (isAdminLogin) {
      context.redirect('/myAppointmentList/appointmentList');
      return;
    }
    context.redirect('/')
  }
}
 
export default errorRouteMiddleware