From 44902ae7db654c8e77bdf324b418338e89f35453 Mon Sep 17 00:00:00 2001 From: Kostya Date: Sun, 28 Jan 2024 02:08:57 +0300 Subject: [PATCH] added if-block for checking if user have cookie-files --- luckydiamond/src/components/HeaderComponent.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/luckydiamond/src/components/HeaderComponent.vue b/luckydiamond/src/components/HeaderComponent.vue index 50da6ce..f9da471 100644 --- a/luckydiamond/src/components/HeaderComponent.vue +++ b/luckydiamond/src/components/HeaderComponent.vue @@ -18,6 +18,7 @@ export default { logout() { this.auth = false; this.balance = 0; + this.authtoken = '' DeleteAllCookie(); }, updateBalanceMethod() { @@ -32,6 +33,7 @@ export default { return { balance: 0, auth: false, + authtoken: '', imageUrl: "https://avatar.spworlds.ru/face/55/", userName: "", }; @@ -57,6 +59,7 @@ export default { this.imageUrl = this.imageUrl + `${response.spUserName}.png`; this.userName = response.spUserName; this.auth = true; + this.authtoken = response.authtoken GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken")) .then((response) => { this.balance = response.currentMoney; @@ -81,6 +84,7 @@ export default { this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.userName = GetCookie("SpUserName"); this.auth = true; + this.authtoken = GetCookie('AUTHTOKEN') } else { this.auth = false; this.balance = 0; @@ -102,6 +106,7 @@ export default { this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.userName = GetCookie("SpUserName"); this.auth = true; + this.authtoken = GetCookie('AUTHTOKEN') } else { this.auth = false; this.balance = 0; @@ -122,12 +127,12 @@ export default {
-
+

{{