From 7c76b2af8d175afee6d9e632ff9d9a6ab96eaafe Mon Sep 17 00:00:00 2001 From: Hepatica Date: Sun, 25 Feb 2024 17:19:17 +0100 Subject: [PATCH] teryt --- .../src/components/HeaderComponent.vue | 72 +++++++++++++------ 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/luckydiamond/src/components/HeaderComponent.vue b/luckydiamond/src/components/HeaderComponent.vue index 3f840dd..94b72d8 100644 --- a/luckydiamond/src/components/HeaderComponent.vue +++ b/luckydiamond/src/components/HeaderComponent.vue @@ -4,7 +4,7 @@ import "@/assets/css/ComponentsStyles/header.css"; import { LogIn } from "@/assets/js/authentication/AuthService.js"; import { GetCurrentMoney } from "@/assets/js/rest/RestMethods.js"; -import {eventBus} from "@/main"; +import { eventBus } from "@/main"; import { SetCookie, @@ -18,30 +18,31 @@ export default { logout() { this.auth = false; this.balance = 0; - this.authtoken = '' + this.authtoken = ""; DeleteAllCookie(); }, updateBalanceMethod() { - GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken")) - .then(response => { - this.balance = response.currentMoney - }) - eventBus.emit('Updatebalance-saper') - } + GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken")).then( + (response) => { + this.balance = response.currentMoney; + } + ); + eventBus.emit("Updatebalance-saper"); + }, }, data() { return { balance: 0, auth: false, - authtoken: '', + authtoken: "", imageUrl: "https://avatar.spworlds.ru/face/55/", userName: "", }; }, mounted() { - eventBus.on('Updatebalance', () => { - this.updateBalanceMethod() - }) + eventBus.on("Updatebalance", () => { + this.updateBalanceMethod(); + }); }, created() { try { @@ -58,7 +59,7 @@ export default { this.imageUrl = this.imageUrl + `${response.spUserName}.png`; this.userName = response.spUserName; this.auth = true; - this.authtoken = response.authtoken + this.authtoken = response.authtoken; GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken")) .then((response) => { this.balance = response.currentMoney; @@ -82,7 +83,7 @@ export default { this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.userName = GetCookie("SpUserName"); this.auth = true; - this.authtoken = GetCookie('AUTHTOKEN') + this.authtoken = GetCookie("AUTHTOKEN"); } else { this.auth = false; this.balance = 0; @@ -104,7 +105,7 @@ export default { this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.userName = GetCookie("SpUserName"); this.auth = true; - this.authtoken = GetCookie('AUTHTOKEN') + this.authtoken = GetCookie("AUTHTOKEN"); } else { this.auth = false; this.balance = 0; @@ -120,14 +121,39 @@ export default {
@@ -160,7 +186,7 @@ export default {
Вход - + + +