mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Update news view to check if the user has faved a news article or not &
the star button finally do something for the two weeks that is there. Also done SOME user auth logic (aka revert bac kthe changes)
This commit is contained in:
parent
846c27293d
commit
5f37fb5049
2 changed files with 22 additions and 12 deletions
|
@ -7,16 +7,6 @@ const error = ref(false);
|
|||
const errorMsg = ref("");
|
||||
const emit = defineEmits(["windowopener", "error", "loadValue"]);
|
||||
|
||||
/**
|
||||
* return {
|
||||
userAccount: fetchViaSQL[0].username,
|
||||
firstName: fetchViaSQL[0].firstName,
|
||||
requested_action: "CONTINUE",
|
||||
current_spot: "KEEP_LOGIN",
|
||||
email: fetchViaSQL[0].email,
|
||||
avatarURL: fetchViaSQL[0].avatarurl,
|
||||
};
|
||||
*/
|
||||
try {
|
||||
// 喔 我沒有加 await :( 難怪有問題
|
||||
const { data, error: sendError } = await useFetch(
|
||||
|
@ -25,7 +15,7 @@ try {
|
|||
if (sendError.value) {
|
||||
error.value = true;
|
||||
}
|
||||
if (data.requested_action === "KEEP_LOGIN") {
|
||||
if (data.requested_action === "CONTINUE") {
|
||||
if (data.userAccount && data.userAccount.length !== 0) {
|
||||
allowed.value = true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue