feat: 註冊登入流程修改
This commit is contained in:
@@ -3,6 +3,7 @@ import Appointment from "@/pages/appointment.vue";
|
||||
import BodyComposition from "@/pages/body-composition.vue";
|
||||
import Checkin from "@/pages/checkin.vue";
|
||||
import CheckinDetail from "@/pages/checkinDetail.vue";
|
||||
import CompleteEmail from "@/pages/complete-email.vue";
|
||||
import Course from "@/pages/course.vue";
|
||||
import Index from "@/pages/index.vue";
|
||||
import Login from "@/pages/login.vue";
|
||||
@@ -12,6 +13,7 @@ import {
|
||||
APPOINTMENT_ENABLED,
|
||||
BODY_COMPOSITION_ENABLED,
|
||||
CHECKIN_ENABLED,
|
||||
EMAIL_COMPLETION_REQUIRED,
|
||||
} from "@/config/features";
|
||||
import { useAppStore } from "@/stores/app";
|
||||
import { useCourseStore } from "@/stores/course";
|
||||
@@ -53,6 +55,15 @@ const router = createRouter({
|
||||
component: SelfAssessment,
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "/complete-email",
|
||||
name: "complete-email",
|
||||
component: CompleteEmail,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "補登 E-Mail|運動玩轉健康力",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/profile",
|
||||
redirect: { name: "home" },
|
||||
@@ -129,6 +140,18 @@ router.beforeEach(async (to) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
EMAIL_COMPLETION_REQUIRED &&
|
||||
store.isLoggedIn &&
|
||||
store.requiresEmailCompletion &&
|
||||
to.name !== "complete-email"
|
||||
) {
|
||||
return {
|
||||
name: "complete-email",
|
||||
query: { redirect: to.fullPath },
|
||||
};
|
||||
}
|
||||
|
||||
if (to.meta.requiresFitnessGroup) {
|
||||
const courseStore = useCourseStore();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user