fix redirect url by permission

This commit is contained in:
Warunee Tamkoo 2025-06-25 09:39:20 +07:00
parent aad739ce83
commit 5c3f5ebd94

View file

@ -86,7 +86,7 @@ async function getName() {
* @param sys ระบบทองการเขาถ * @param sys ระบบทองการเขาถ
* @param url งคของระบบทองการเขาถ * @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 token = await getCookie(cookieTokenName);
const redirectUrl = (route.query.redirectUrl as string) ?? ""; // new const redirectUrl = (route.query.redirectUrl as string) ?? ""; // new
@ -124,6 +124,9 @@ async function goPage(sys: string, url: string) {
} }
} else { } else {
// alert(""); // alert("");
if (auto) {
return (window.location.href = `${window.location.origin}${window.location.pathname}`);
}
$q.dialog({ $q.dialog({
component: CustomComponent, component: CustomComponent,
componentProps: { componentProps: {
@ -236,7 +239,8 @@ onMounted(async () => {
? urlMgt ? urlMgt
: systemkey === "admin" : systemkey === "admin"
? urlAdmin ? urlAdmin
: "" : "",
true
); );
} }
} }