From 08477511256e5a58b072dabfcd83f725a4f55f9b Mon Sep 17 00:00:00 2001 From: abearxiong Date: Mon, 2 Jun 2025 23:23:30 +0800 Subject: [PATCH] fix: astro config for proxy --- astro.config.mjs | 6 +----- src/apps/assistant-home/index.tsx | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 6319d6a..9ea9c5b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -15,11 +15,7 @@ if (isDev && !isCNB) { let target = process.env.VITE_API_URL || 'https://localhost:51015'; const apiProxy = { target: target, changeOrigin: true, ws: true, rewriteWsOrigin: true, secure: false, cookieDomainRewrite: 'localhost' }; let proxy = { - '/root/center/': { - target: `${target}`, - secure: false, - }, - '/root/resources/': { + '/root/': { target: `${target}`, secure: false, }, diff --git a/src/apps/assistant-home/index.tsx b/src/apps/assistant-home/index.tsx index 5f1417d..13ac5c2 100644 --- a/src/apps/assistant-home/index.tsx +++ b/src/apps/assistant-home/index.tsx @@ -7,6 +7,13 @@ import { html2md } from '@kevisual/markdown-editor/tiptap/index.ts'; import { chatId } from '../ai-chat/utils/uuid'; import '../ai-chat/index.css'; import { links } from './data/link.ts'; +// const testImport = async () => { +// const link1 = 'https://kevisual.xiongxiao.me/root/ai/code/frontend-js/test.js'; +// const link2 = () => '/root/ai/code/frontend-js/test.js'; +// // @ts-ignore +// const link = await import(link2()); +// console.log('testImport', link); +// }; export const Editor = () => { const ref = useRef(null); const editorRef = useRef(null); @@ -30,6 +37,10 @@ export const Editor = () => { ); }; export const App = (props: any) => { + useEffect(() => { + // testImport(); + // console.log('chatId', chatId()); + }, []); return (