From 9f89c0fd745ee89703a0f82659a81a7d3d30e5dd Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 18 Nov 2024 14:04:11 +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=B9=80=E0=B8=A1=E0=B8=99=E0=B8=B9=E0=B9=84=E0=B8=9B=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=89=E0=B8=B2=20Landing=20Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/MainView.vue | 76 +++++++++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 6d80cf9..63e69de 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -16,6 +16,11 @@ const { date2Thai, hideLoader, messageError, dialogRemove, success } = mixin const router = useRouter() const $q = useQuasar() +// landing page config url +const configParam = { + landingPageUrl: import.meta.env.VITE_URL_SSO, +} + const fullName = ref('') //ชื่อผู้ใช้งาน const notiTrigger = ref(false) // เปิด,ปิดรายการ const notiList = ref([]) // รายการแจ้งเตือน @@ -129,13 +134,24 @@ function onLoad(index: number, done: Function) { (notiList.value.length == 0 && totalNotiList.value === 0) ) { page.value++ - setTimeout(() => { - fetchNotifications(page.value, 'NOMAL') - done() + setTimeout(async () => { + await fetchNotifications(page.value, 'NOMAL') + await done() }, 1500) } } +// 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` + } +} + watch( () => notiTrigger.value, () => { @@ -311,7 +327,16 @@ onMounted(async () => { >
- +
+ + + + +
+ {{ fullName }} +
+
+ - - - - + + + + + + + + Landing Page + + + + + + ออกจากระบบ + -
+ +