From 57c56c849df33e905dd24af91b70757b16991da1 Mon Sep 17 00:00:00 2001 From: Rogee Date: Thu, 30 Jul 2026 11:29:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E6=8A=A5=20No=20valid=20base=20URL?= =?UTF-8?q?=20found=20in=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:portalHelper.js getDefaultBaseURL() 在 hostURL 和 helpCenterURL 均为空时直接抛错,但 index.html 中两者默认都是空字符串(表示同源)。 当配置为空时应 fallback 到 window.location.origin 而非抛错。 修复:将空字符串 fallback 改为 window.location.origin,移除 throw。 --- frontend/app/javascript/dashboard/helper/portalHelper.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frontend/app/javascript/dashboard/helper/portalHelper.js b/frontend/app/javascript/dashboard/helper/portalHelper.js index 33a2a822..76b92118 100644 --- a/frontend/app/javascript/dashboard/helper/portalHelper.js +++ b/frontend/app/javascript/dashboard/helper/portalHelper.js @@ -13,11 +13,7 @@ const formatCustomDomain = customDomain => */ const getDefaultBaseURL = () => { const { hostURL, helpCenterURL } = window.chatwootConfig || {}; - const baseURL = helpCenterURL || hostURL || ''; - - if (!baseURL) { - throw new Error('No valid base URL found in configuration'); - } + const baseURL = helpCenterURL || hostURL || window.location.origin; return baseURL; };