fix: 帮助中心设置页报 No valid base URL found in configuration

根因:portalHelper.js getDefaultBaseURL() 在 hostURL 和 helpCenterURL
均为空时直接抛错,但 index.html 中两者默认都是空字符串(表示同源)。
当配置为空时应 fallback 到 window.location.origin 而非抛错。

修复:将空字符串 fallback 改为 window.location.origin,移除 throw。
This commit is contained in:
Rogee
2026-07-30 11:29:43 +08:00
parent 73065d6888
commit 57c56c849d
@@ -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;
};