保誠-保戶業務員媒合平台
Mila
2021-12-13 544f91e63a01f37e7b79db99609eec99b1afafd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { Middleware } from '@nuxt/types';
 
const myAppointmentMiddleware: Middleware = (context) => {
  const isAdminLogin = context.store.getters['localStorage/isAdminLogin'];
  if (isAdminLogin) {
    if (context.route.name === 'myAppointmentList') {
      context.redirect('/myAppointmentList/appointmentList')
    }
  } else {
    context.redirect('/consultantLogin');
  }
}
 
export default myAppointmentMiddleware