FRONT правки
Правки фронта
This commit is contained in:
@@ -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 = {}) => {
|
||||
|
||||
Reference in New Issue
Block a user