保誠-保戶業務員媒合平台
update: 1. 顧問未登入進入預約清單, 會導回顧問登入頁 2. 輸入網址為/myAppointmentList會直接導頁到/myAppointmentList/appointmentList
修改1個檔案
新增1個檔案
17 ■■■■■ 已變更過的檔案
PAMapp/middleware/myAppointmentMiddleware.ts 14 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList.vue 3 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/middleware/myAppointmentMiddleware.ts
比對新檔案
@@ -0,0 +1,14 @@
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
PAMapp/pages/myAppointmentList.vue
@@ -44,7 +44,8 @@
import * as _ from 'lodash';
@Component({
    layout: 'home'
    layout: 'home',
    middleware: 'myAppointmentMiddleware'
})
export default class ClientReservedList extends Vue {
    activeTabName = 'appointmentList';