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 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
);
}
}