From 1b874a0264b640c045b0136c292e587a5bb22221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 25 Jan 2025 20:00:24 +0800 Subject: [PATCH] fix: defaultHttpUrl --- napcat.webui/src/components/onebot/api/debug.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/napcat.webui/src/components/onebot/api/debug.tsx b/napcat.webui/src/components/onebot/api/debug.tsx index 17d2ba51..ae18606e 100644 --- a/napcat.webui/src/components/onebot/api/debug.tsx +++ b/napcat.webui/src/components/onebot/api/debug.tsx @@ -28,7 +28,10 @@ export interface OneBotApiDebugProps { const OneBotApiDebug: React.FC = (props) => { const { path, data } = props const url = new URL(window.location.origin).href - const defaultHttpUrl = url.replace(':6099', ':3000') + let defaultHttpUrl = url.replace(':6099', ':3000') + if (defaultHttpUrl.endsWith('/')) { + defaultHttpUrl = defaultHttpUrl.slice(0, -1) + } const [httpConfig, setHttpConfig] = useState({ url: defaultHttpUrl, token: ''