asd
This commit is contained in:
@@ -47,7 +47,6 @@
|
|||||||
B.BASE_PATH_CONFIG = B.BASE_PATH_BRIDGE;
|
B.BASE_PATH_CONFIG = B.BASE_PATH_BRIDGE;
|
||||||
const apiFallback = '/api.php';
|
const apiFallback = '/api.php';
|
||||||
B.API_BASE = B.API_BASE || apiFallback;
|
B.API_BASE = B.API_BASE || apiFallback;
|
||||||
B.STORAGE_URL_BASE = B.STORAGE_URL_BASE || B.API_BASE;
|
|
||||||
B.API_KERNEL_URL = B.API_KERNEL_URL || B.API_BASE;
|
B.API_KERNEL_URL = B.API_KERNEL_URL || B.API_BASE;
|
||||||
|
|
||||||
B.GrapesJSPlugins = [];
|
B.GrapesJSPlugins = [];
|
||||||
@@ -260,9 +259,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Speicherkonfiguration extrahieren, um die URL in onLoad zu verwenden.
|
// Speicherkonfiguration extrahieren, um die URL in onLoad zu verwenden.
|
||||||
// 🎯 KORREKTUR für mehr Flexibilität: Verwende B.STORAGE_URL_BASE, falls gesetzt, anstatt window.location.href.
|
// Verwenden Sie immer die zentrale API-Basis
|
||||||
// Verwenden Sie B.API_BASE (Standard /api/editor) als Fallback für die Storage-URL
|
const storageBase = B.API_BASE;
|
||||||
const storageBase = B.STORAGE_URL_BASE || B.API_BASE; // B.API_BASE sollte jetzt korrekt sein
|
|
||||||
|
|
||||||
// Robustes Anhängen von Query-Parametern.
|
// Robustes Anhängen von Query-Parametern.
|
||||||
// Prüft, ob 'storageBase' bereits Query-Parameter enthält ('?')
|
// Prüft, ob 'storageBase' bereits Query-Parameter enthält ('?')
|
||||||
@@ -270,8 +268,8 @@
|
|||||||
|
|
||||||
const resourceName = (window.__editorMode || 'templates');
|
const resourceName = (window.__editorMode || 'templates');
|
||||||
const entityId = (window.__editorId || 0);
|
const entityId = (window.__editorId || 0);
|
||||||
const loadUrl = `${storageBase}${actionSeparator}action=${resourceName}.get&id=${entityId}`;
|
const loadUrl = `${storageBase}${actionSeparator}action=${encodeURIComponent(resourceName)}.get&id=${encodeURIComponent(entityId)}`;
|
||||||
const storeUrl = `${storageBase}${actionSeparator}action=${resourceName}.update&id=${entityId}`;
|
const storeUrl = `${storageBase}${actionSeparator}action=${encodeURIComponent(resourceName)}.update&id=${encodeURIComponent(entityId)}`;
|
||||||
|
|
||||||
const storageConf = {
|
const storageConf = {
|
||||||
type: 'remote',
|
type: 'remote',
|
||||||
@@ -292,8 +290,8 @@
|
|||||||
...options
|
...options
|
||||||
};
|
};
|
||||||
fetchOptions.headers = {
|
fetchOptions.headers = {
|
||||||
'Content-Type': 'application/json',
|
|
||||||
...(options?.headers || {}),
|
...(options?.headers || {}),
|
||||||
|
'Content-Type': 'application/json',
|
||||||
};
|
};
|
||||||
if (!fetchOptions.credentials || fetchOptions.credentials === 'omit') {
|
if (!fetchOptions.credentials || fetchOptions.credentials === 'omit') {
|
||||||
fetchOptions.credentials = 'include';
|
fetchOptions.credentials = 'include';
|
||||||
|
|||||||
Reference in New Issue
Block a user