From 00e061023ece44898d6da9429ed55997d6c05363 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 26 Dec 2025 11:58:21 +0800 Subject: [PATCH] fix(web): get the parent domain name adaptation IP --- web/src/utils/request.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/utils/request.ts b/web/src/utils/request.ts index 647b30f6..447ff88c 100644 --- a/web/src/utils/request.ts +++ b/web/src/utils/request.ts @@ -302,6 +302,10 @@ export const request = { // 获取父级域名 const getParentDomain = () => { const hostname = window.location.hostname + // 检查是否为IP地址 + if (/^\d+\.\d+\.\d+\.\d+$/.test(hostname)) { + return hostname + } const parts = hostname.split('.') return parts.length > 2 ? `.${parts.slice(-2).join('.')}` : hostname }