From 5c3f5ebd94bb31b098d7299fd6de6750a45f4c38 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 25 Jun 2025 09:39:20 +0700 Subject: [PATCH] fix redirect url by permission --- src/views/home.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/home.vue b/src/views/home.vue index f6083b7..cfdda87 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -86,7 +86,7 @@ async function getName() { * @param sys ระบบที่ต้องการเข้าถึง * @param url ลิงค์ของระบบที่ต้องการเข้าถึง */ -async function goPage(sys: string, url: string) { +async function goPage(sys: string, url: string, auto: boolean = false) { const token = await getCookie(cookieTokenName); const redirectUrl = (route.query.redirectUrl as string) ?? ""; // new @@ -124,6 +124,9 @@ async function goPage(sys: string, url: string) { } } else { // alert("คุณไม่มีสิทธิ์เข้าใช้งานระบบนี้"); + if (auto) { + return (window.location.href = `${window.location.origin}${window.location.pathname}`); + } $q.dialog({ component: CustomComponent, componentProps: { @@ -236,7 +239,8 @@ onMounted(async () => { ? urlMgt : systemkey === "admin" ? urlAdmin - : "" + : "", + true ); } }