update: 1. 顧問未登入進入預約清單, 會導回顧問登入頁 2. 輸入網址為/myAppointmentList會直接導頁到/myAppointmentList/appointmentList
比對新檔案 |
| | |
| | | import { Middleware } from '@nuxt/types'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | |
| | | const myAppointmentMiddleware: Middleware = (context) => { |
| | | if (context.store.getters['localStorage/currentRole'] === Role.ADMIN) { |
| | | if (context.route.name === 'myAppointmentList') { |
| | | context.redirect('/myAppointmentList/appointmentList') |
| | | } |
| | | } else { |
| | | context.redirect('/consultantLogin'); |
| | | } |
| | | } |
| | | |
| | | export default myAppointmentMiddleware |
| | |
| | | import * as _ from 'lodash'; |
| | | |
| | | @Component({ |
| | | layout: 'home' |
| | | layout: 'home', |
| | | middleware: 'myAppointmentMiddleware' |
| | | }) |
| | | export default class ClientReservedList extends Vue { |
| | | activeTabName = 'appointmentList'; |