This commit is contained in:
Hepatica
2023-12-02 05:29:29 +01:00
parent 0d78b3bd13
commit 59c0457f91
2 changed files with 20 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ export async function GetCurrentMoney(authToken, searchToken) {
} }
const data = await response.json(); const data = await response.json();
console.log(data); // Здесь вы можете обработать полученные данные console.log(data);
return data; return data;
} catch (error) { } catch (error) {
console.error('There was a problem with the fetch operation:', error); console.error('There was a problem with the fetch operation:', error);

View File

@@ -42,24 +42,32 @@ export default {
this.userName = response.spUserName; this.userName = response.spUserName;
this.auth = true; this.auth = true;
let currentMoney = GetCurrentMoney( let currentMoney = GetCurrentMoney(
GetCookie("AuthToken"), response.authtoken,
GetCookie("SearchToken") response.searchToken
); );
this.balance = currentMoney; this.balance = currentMoney;
}) })
.catch((error) => { .catch((error) => {
console.error("Auth Code error:", error); let currentUserName = GetCookie("SpUserName");
let currentMoney = GetCurrentMoney(
GetCookie("AUTHTOKEN"),
GetCookie("SearchToken")
);
if (currentUserName) {
this.imageUrl = this.imageUrl + `${currentUserName}.png`;
this.auth = true;
this.balance = currentMoney;
} else {
this.auth = false;
}
}); });
} else { } else {
let currentUserName = GetCookie("SpUserName"); let currentUserName = GetCookie("SpUserName");
let currentMoney = GetCurrentMoney( let currentMoney = GetCurrentMoney(
GetCookie("AuthToken"), GetCookie("AUTHTOKEN"),
GetCookie("SearchToken") GetCookie("SearchToken")
); );
// let currentMoney = GetCurrentMoney(
// "2405bf72008f835c9f5b336a84d3efbd7a742b828ca41fcaab1c40ca842e6425"
// );
// let currentMoney = GetCurrentMoney(GetCookie("AuthToken"));
if (currentUserName) { if (currentUserName) {
this.imageUrl = this.imageUrl + `${currentUserName}.png`; this.imageUrl = this.imageUrl + `${currentUserName}.png`;