1
0

FRONT правки

Правки фронта
This commit is contained in:
2026-01-12 04:03:44 +07:00
parent cd2e291394
commit 61c336b703
5 changed files with 20 additions and 20 deletions

View File

@@ -1,5 +1,14 @@
// Базовый URL API (берётся из внешнего config.js)
const API_BASE = window.APP_CONFIG?.API_BASE || 'http://localhost'
const API_BASE = window.APP_CONFIG?.API_BASE || ''
// Формирование полного URL (добавляет домен к относительным путям)
export const getFullUrl = (url) => {
if (!url) return ''
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('data:')) {
return url
}
return API_BASE + url
}
// Базовая функция запроса
const request = async (endpoint, options = {}) => {