mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Remove legacy component & Update validating system using localstorage.
This commit is contained in:
parent
b716a0ed5c
commit
c5c614c75d
7 changed files with 141 additions and 86 deletions
|
@ -1,13 +1,32 @@
|
|||
<script setup lang="ts">
|
||||
const logoutAction = () => {
|
||||
const user = ref();
|
||||
const userToken = localStorage.getItem("token");
|
||||
const { t, locale } = useI18n();
|
||||
onMounted(async () => {
|
||||
const req = await fetch("/api/user/validateUserToken", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: userToken,
|
||||
lang: locale,
|
||||
page: "settings",
|
||||
}),
|
||||
});
|
||||
const res = req.json();
|
||||
user.value = res;
|
||||
});
|
||||
|
||||
}
|
||||
const logoutAction = () => {};
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<div class="bg-gray-400 p-2 m-2 w-full">
|
||||
<div class="justify-center align-center text-center">
|
||||
<div class="">Greetings, {{ user }}</div>
|
||||
<div class="bg-gray-200/70 p-2 m-2 w-full">
|
||||
<button @click="logoutAction">Logout</button>
|
||||
</div>
|
||||
<hr/>
|
||||
<hr />
|
||||
<div class="justiy-center align-center text-center">Settings v0.0.1</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue