fix bug with money

This commit is contained in:
Hepatica
2023-12-02 16:19:33 +01:00
parent 9e2a7136f4
commit 7fb400b559

View File

@@ -48,36 +48,23 @@ export default {
console.log(response); console.log(response);
}) })
.catch((error) => { .catch((error) => {
// Обработка ошибки
console.error(error); console.error(error);
}); });
// let currentMoney = GetCurrentMoney(
// response.authtoken,
// response.searchToken
// );
// this.balance = currentMoney;
}) })
.catch(() => { .catch(() => {
let currentUserName = GetCookie("SpUserName"); let currentUserName = GetCookie("SpUserName");
// let currentMoney = GetCurrentMoney(
// GetCookie("AUTHTOKEN"),
// GetCookie("SearchToken")
// ).then(response);
GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken")) GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
.then((response) => { .then((response) => {
this.balance = response.currentMoney; this.balance = response.currentMoney;
console.log(response); console.log(response);
}) })
.catch((error) => { .catch((error) => {
// Обработка ошибки
console.error(error); console.error(error);
}); });
if (currentUserName) { if (currentUserName) {
this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.imageUrl = this.imageUrl + `${currentUserName}.png`;
this.userName = GetCookie("SpUserName");
this.auth = true; this.auth = true;
} else { } else {
this.auth = false; this.auth = false;
@@ -98,6 +85,7 @@ export default {
if (currentUserName) { if (currentUserName) {
this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.imageUrl = this.imageUrl + `${currentUserName}.png`;
this.userName = GetCookie("SpUserName");
this.auth = true; this.auth = true;
} else { } else {
this.auth = false; this.auth = false;