From 8395b390b00d87e50c59edf950b9b1abeeb2285e Mon Sep 17 00:00:00 2001 From: lapuda <577732344@qq.com> Date: Tue, 14 Jul 2026 23:22:53 +0800 Subject: [PATCH] refactor: Update public and API base URL functions in company and detail pages for improved clarity --- .../resources/static/h5/outdoor-fair/company.html | 13 +++++++++---- .../resources/static/h5/outdoor-fair/detail.html | 11 ++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/h5/outdoor-fair/company.html b/ruoyi-admin/src/main/resources/static/h5/outdoor-fair/company.html index 426806f..a933458 100644 --- a/ruoyi-admin/src/main/resources/static/h5/outdoor-fair/company.html +++ b/ruoyi-admin/src/main/resources/static/h5/outdoor-fair/company.html @@ -104,14 +104,19 @@ }); } - // 反向代理子路径(如 /api/shihezi)下,依据当前页面路径推导 API 前缀, - // 保证 /app/... 请求带上子路径,避免落到根路径 404。 - function apiBase() { + // 页面和 API 使用不同的代理前缀: + // 页面:/shihezi/h5/... + // API:/api/shihezi/... + function publicBase() { var path = window.location.pathname; var idx = path.indexOf('/h5/'); return idx > 0 ? path.slice(0, idx) : ''; } + function apiBase() { + return '/api' + publicBase(); + } + function apiUrl() { if (deviceCode) { return apiBase() + '/app/outdoor-fair/company-page?deviceCode=' + encodeURIComponent(deviceCode); @@ -165,7 +170,7 @@ '' + '
' + '