This commit is contained in:
Viet An
2026-05-14 15:37:58 +07:00
parent 4d37397ee4
commit 1f44f9e6bf
17 changed files with 670 additions and 324 deletions

View File

@@ -30,9 +30,10 @@ import { throttle } from "es-toolkit";
const route = useRoute();
const { $getdata, $requestLogin, $store } = useNuxtApp();
var authorized = ref(false);
const authorized = ref(false);
const snackbar = ref(undefined);
const showmodal = ref(undefined);
function getViewport() {
let viewport;
const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
@@ -52,6 +53,7 @@ function getViewport() {
$store.commit("viewport", viewport);
}
}
async function checkRedirect() {
if (route.query.username && route.query.token) {
let row = await $getdata(
@@ -71,6 +73,7 @@ async function checkRedirect() {
} else if (!$store.login) return; /* $requestLogin(); */
// await checkLogin();
}
async function checkLogin() {
if ($store.login ? $store.login.token : false) {
$store.commit("rights", await $getdata("grouprights", { group: $store.login.type }));
@@ -80,6 +83,7 @@ async function checkLogin() {
}
// else $requestLogin();
}
onMounted(() => {
checkRedirect();
getViewport();
@@ -95,7 +99,7 @@ watch(
);
watch(
() => $store.showmodal,
(newVal, oldVal) => {
(newVal) => {
showmodal.value = newVal;
},
);