feat: bmi
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
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 Course from "@/pages/course.vue";
|
||||
@@ -53,6 +54,16 @@ const router = createRouter({
|
||||
component: Profile,
|
||||
meta: { requiresAuth: true, title: "個人資料修改|運動玩轉健康力" },
|
||||
},
|
||||
{
|
||||
path: "/body-composition",
|
||||
name: "body-composition",
|
||||
component: BodyComposition,
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
requiresUserID: true,
|
||||
title: "身體數值分析|運動玩轉健康力",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/appointment",
|
||||
name: "appointment",
|
||||
@@ -106,6 +117,13 @@ router.beforeEach(async (to) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (to.meta.requiresUserID && !store.userID.trim()) {
|
||||
return {
|
||||
name: "login",
|
||||
query: { redirect: to.fullPath },
|
||||
};
|
||||
}
|
||||
|
||||
if (to.meta.requiresFitnessGroup) {
|
||||
const courseStore = useCourseStore();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user