ad then events

This commit is contained in:
Hepatica
2023-12-02 06:46:25 +01:00
parent 05fe9d98ae
commit 1abb58e267

View File

@@ -41,39 +41,62 @@ export default {
this.imageUrl = this.imageUrl + `${response.spUserName}.png`; this.imageUrl = this.imageUrl + `${response.spUserName}.png`;
this.userName = response.spUserName; this.userName = response.spUserName;
this.auth = true; this.auth = true;
let currentMoney = GetCurrentMoney( GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
response.authtoken, .then((response) => {
response.searchToken this.balance = response.currentMoney;
); console.log(response);
this.balance = currentMoney; })
.catch((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"), // let currentMoney = GetCurrentMoney(
GetCookie("SearchToken") // GetCookie("AUTHTOKEN"),
); // GetCookie("SearchToken")
// ).then(response);
GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
.then((response) => {
this.balance = response.currentMoney;
console.log(response);
})
.catch((error) => {
// Обработка ошибки
console.error(error);
});
if (currentUserName) { if (currentUserName) {
this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.imageUrl = this.imageUrl + `${currentUserName}.png`;
this.auth = true; this.auth = true;
this.balance = currentMoney;
} else { } else {
this.auth = false; this.auth = false;
} }
}); });
} else { } else {
let currentUserName = GetCookie("SpUserName"); let currentUserName = GetCookie("SpUserName");
let currentMoney = GetCurrentMoney( GetCurrentMoney(GetCookie("AUTHTOKEN"), GetCookie("SearchToken"))
GetCookie("AUTHTOKEN"), .then((response) => {
GetCookie("SearchToken") this.balance = response.currentMoney;
); console.log(response);
})
.catch((error) => {
// Обработка ошибки
console.error(error);
});
if (currentUserName) { if (currentUserName) {
this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.imageUrl = this.imageUrl + `${currentUserName}.png`;
this.auth = true; this.auth = true;
this.balance = currentMoney;
} else { } else {
this.auth = false; this.auth = false;
} }