mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14: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,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
// Imports
|
||||
const { t } = useI18n();
|
||||
const { t, locale } = useI18n();
|
||||
// Values
|
||||
const allowed = ref(false);
|
||||
const error = ref(false);
|
||||
|
@ -9,7 +9,21 @@ const emit = defineEmits(["windowopener", "error", "loadValue"]);
|
|||
|
||||
try {
|
||||
// 喔 我沒有加 await :( 難怪有問題
|
||||
const { data, error: sendError } = await useFetch("/api/user/checkcookie");
|
||||
const token = localStorage.getItem("token");
|
||||
const { data, error: sendError } = await useFetch(
|
||||
"/api/user/validateUserToken",
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: token,
|
||||
lang: locale,
|
||||
page: "a_window_application_using_blurPageBeforeLogin_component",
|
||||
}),
|
||||
},
|
||||
);
|
||||
if (sendError.value) {
|
||||
error.value = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue