fixed 輸入錯誤的url 1. 顧問登入下直接導到/myAppointmentList/appointmentList 2. 其餘狀況導到首頁
比對新檔案 |
| | |
| | | import { Middleware } from '@nuxt/types'; |
| | | import { Role } from '~/assets/ts/models/enum/Role'; |
| | | |
| | | const errorRouteMiddleware: Middleware = (context) => { |
| | | if (!context.route.name) { |
| | | if (context.store.getters['localStorage/currentRole'] === Role.ADMIN) { |
| | | context.redirect('/myAppointmentList/appointmentList'); |
| | | return; |
| | | } |
| | | context.redirect('/') |
| | | } |
| | | } |
| | | |
| | | export default errorRouteMiddleware |
| | |
| | | ] |
| | | }, |
| | | router: { |
| | | base: process.env.ENV === 'uat' ? '/pam/' : '' |
| | | base: process.env.ENV === 'uat' ? '/pam/' : '', |
| | | middleware: 'errorRouteMiddleware' |
| | | } |
| | | } |