changes
This commit is contained in:
@@ -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;
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user