From bd033e61314daf4bd8da82007ec70415812dec87 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 18 Nov 2024 13:43:38 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=9B=E0=B8=B8=E0=B9=88=E0=B8=A1=E0=B8=81=E0=B8=A5=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=20Landing=20Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/MainLayout.vue | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index b48f710..13b24ac 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -11,6 +11,11 @@ import { tokenParsed, logout } from "@/plugins/auth"; import { useDataStore } from "@/stores/data"; +// landing page config url +const configParam = { + landingPageUrl: import.meta.env.VITE_URL_SSO, +}; + const route = useRoute(); const router = useRouter(); @@ -212,9 +217,9 @@ const handleButtonClick = async () => { const currentPath = route.name; const queryParams = { role: "user" }; // Replace with your query parameters const queryString = new URLSearchParams(queryParams).toString(); - const type = await dataStore.getProFileType() + const type = await dataStore.getProFileType(); // Assuming config.generatePopupPath() returns a base URL - const popupBasePath = config.generatePopupPath(currentPath,type); + const popupBasePath = config.generatePopupPath(currentPath, type); if (popupBasePath) { const popupPath = `${popupBasePath}?${queryString}`; @@ -227,6 +232,17 @@ const handleButtonClick = async () => { function onInfo() { router.push(`/retire`); } + +// landing page redirect +const landingPageUrl = () => { + if (window.location.hostname === "bmasso.bma.go.th") { + return `${configParam.landingPageUrl}/landing?mode=dev`; + } else if (window.location.hostname === "bma-ehr.frappet.com") { + return `${configParam.landingPageUrl}/landing?mode=prod`; + } else { + return `${configParam.landingPageUrl}/landing?mode=dev`; + } +}; @@ -484,6 +500,19 @@ function onInfo() { + + + + + Landing Page + +