This commit is contained in:
12
server.js
12
server.js
@@ -86,7 +86,17 @@ router.post("/clear-all-sms", (req, res) => {
|
||||
});
|
||||
|
||||
// GET /balance - get account balance (SMSC API compatible)
|
||||
router.get("/balance", (req, res) => {
|
||||
router.get("/balance.php", (req, res) => {
|
||||
const { login, psw } = req.query;
|
||||
|
||||
if (!login || !psw) {
|
||||
return res.json({ error: "Отсутствуют обязательные параметры", error_code: 1 });
|
||||
}
|
||||
|
||||
if (login !== AUTH_LOGIN || psw !== AUTH_PASSWORD) {
|
||||
return res.json({ error: "Ошибка авторизации", error_code: 2 });
|
||||
}
|
||||
|
||||
res.json({ balance: "1000.00" });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user