refactor: basePath als Umgebungsvariable eingeführt (NEXT_PUBLIC_BASE_PATH)

- alle festen "/talas5/" Pfade entfernt
- dynamischer basePath für API-Links und Station öffnen
- README.md und CHANGELOG.md aktualisiert
- Version erhöht auf 1.1.188
This commit is contained in:
ISA
2025-05-27 11:58:28 +02:00
parent 1a4d5e6112
commit cdca624874
17 changed files with 99 additions and 28 deletions

View File

@@ -8,14 +8,15 @@
*/
export const fetchGisSystemStaticService = async () => {
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
const apiBaseUrl = mode === "dev" ? `${window.location.protocol}//${window.location.hostname}:80/talas5/ClientData/WebServiceMap.asmx` : `${window.location.origin}/talas5/ClientData/WebServiceMap.asmx`;
const baseUrl = mode === "dev" ? `${window.location.protocol}//${window.location.hostname}:80${basePath}/ClientData/WebServiceMap.asmx` : `${window.location.origin}${basePath}/ClientData/WebServiceMap.asmx`;
const params = new URLSearchParams(window.location.search);
const idMap = params.get("m");
const idUser = params.get("u");
const url = `${apiBaseUrl}/GisSystemStatic?idMap=${idMap}&idUser=${idUser}`;
const url = `${baseUrl}/GisSystemStatic?idMap=${idMap}&idUser=${idUser}`;
console.log("📡 fetchGisSystemStaticService von service URL:", url);
const response = await fetch(url);