This commit is contained in:
@@ -188,9 +188,15 @@
|
||||
|
||||
async function loadBalance() {
|
||||
try {
|
||||
const res = await fetch(basePath + "/balance");
|
||||
const config = window.SMS_CONFIG || {};
|
||||
const params = new URLSearchParams({ login: config.login, psw: config.psw });
|
||||
const res = await fetch(basePath + "/balance?" + params);
|
||||
const data = await res.json();
|
||||
document.getElementById("balance").textContent = data.balance;
|
||||
if (data.error) {
|
||||
document.getElementById("balance").textContent = "Auth Error";
|
||||
} else {
|
||||
document.getElementById("balance").textContent = data.balance;
|
||||
}
|
||||
} catch (err) {
|
||||
document.getElementById("balance").textContent = "Error";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user