changes
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<template>
|
||||
<div style="min-height: 100vh" class="has-background-white" data-theme="light" lang="vi" v-if="authorized">
|
||||
<slot />
|
||||
|
||||
<div
|
||||
style="min-height: 100vh"
|
||||
class="has-background-white"
|
||||
data-theme="light"
|
||||
lang="vi"
|
||||
>
|
||||
<slot></slot>
|
||||
<SnackBar v-if="snackbar" v-bind="snackbar" @close="$store.removeSnackbar()" />
|
||||
|
||||
<Modal v-if="showmodal" v-bind="showmodal" @close="showmodal = undefined" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -39,12 +42,12 @@ async function checkRedirect() {
|
||||
},
|
||||
true
|
||||
);
|
||||
if (row === "error" || row === undefined) $requestLogin();
|
||||
if (row === "error" || row === undefined) return; /* $requestLogin(); */
|
||||
else {
|
||||
row.token = route.query.token;
|
||||
$store.commit("login", row);
|
||||
}
|
||||
} else if (!$store.login) return $requestLogin();
|
||||
} else if (!$store.login) return /* $requestLogin(); */
|
||||
await checkLogin();
|
||||
}
|
||||
async function checkLogin() {
|
||||
@@ -58,9 +61,10 @@ async function checkLogin() {
|
||||
true
|
||||
));
|
||||
let authtoken = await $getdata("token", { token: $store.login.token }, undefined, true);
|
||||
if (authtoken ? authtoken.expiry : true) return $requestLogin();
|
||||
if (authtoken ? authtoken.expiry : true) return /* $requestLogin(); */
|
||||
authorized.value = true;
|
||||
} else $requestLogin();
|
||||
}
|
||||
// else $requestLogin();
|
||||
}
|
||||
onMounted(() => {
|
||||
checkRedirect()
|
||||
|
||||
Reference in New Issue
Block a user