保誠-保戶業務員媒合平台
Tomas
2022-01-17 771d43f1f81238e9f6fb86d90c11b2f7b949d143
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