From 90126beb35edee7e0b647e61540b9af6e05c5d57 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Wed, 25 Jun 2025 00:48:25 +0800 Subject: [PATCH] temp --- src/App.tsx | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f80a88a..ef0f5ad 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,6 +9,13 @@ import { CodeDescModal } from './modules/CodeDescModal'; import { query } from './modules/query.ts'; import { toastSuccess, toastWeChat } from './modules/RedirectSuccess.tsx'; import { WeChat } from './components/Icon.tsx'; +const getOrigin = () => { + let origin = window.location.origin; + if (origin.includes('www.kevisual.cn')) { + origin = origin.replace('www.kevisual.cn', 'kevisual.cn'); + } + return origin; +}; export const Main = () => { const [showPreview, setShowPreview] = useState(false); const [html, setHtml] = useState(''); @@ -30,10 +37,7 @@ export const Main = () => { if (res.code === 200) { const url = res.data?.url; if (url) { - let origin = window.location.origin; - if (origin.includes('www.kevisual.cn')) { - origin = origin.replace('www.kevisual.cn', 'kevisual.cn'); - } + let origin = getOrigin(); const newUrl = new URL(url, origin); // toast.success('创建成功, 访问地址' + newUrl.toString(), { autoClose: 3000 }); toastSuccess(newUrl.toString()); @@ -54,10 +58,19 @@ export const Main = () => { 可视化助手 Logo
- + { + e.preventDefault(); + const url = new URL('/root/center/', getOrigin()); + window.open(url.toString(), '_blank'); + }}> + 管理中心 + + 功能 - + 联系方式
@@ -106,6 +119,7 @@ export const Main = () => { )}