保誠-保戶業務員媒合平台
wayne
2022-01-22 3dd41875f8a623bda069ab4f9c1e2fd6c757c44e
PAMapp/middleware/getUrlQuery.ts
@@ -3,9 +3,13 @@
const getUrlQuery: Middleware = (context) => {
  const currentRouteName = context.route.name;
  const satisfactionIdFromMsg = context.route.query.appointmentId;
  const isUserLogin = context.store.getters['localStorage/isUserLogin'];
  if (currentRouteName === 'index' && satisfactionIdFromMsg) {
    context.store.commit('localStorage/storageSatisfactionIdFromMsg', satisfactionIdFromMsg);
    if (!isUserLogin) {
      context.redirect('/login');
    }
  }
}