From f2f602a6c9bf9b490581e6664216bb7639328935 Mon Sep 17 00:00:00 2001 From: Agent Date: Tue, 14 Jul 2026 19:24:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A6=81=E7=94=A8crossorigin=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E9=81=BF=E5=85=8DExpress=E9=9D=99=E6=80=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=97=A0CORS=E5=A4=B4=E5=AF=BC=E8=87=B4JS?= =?UTF-8?q?=E8=A2=AB=E9=98=BB=E6=AD=A2=EF=BC=88=E7=A9=BA=E7=99=BD=E9=A1=B5?= =?UTF-8?q?=E6=A0=B9=E5=9B=A0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/vite.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index c02de70..9e2b07c 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -5,5 +5,10 @@ import { resolve } from 'path' export default defineConfig({ plugins: [vue()], resolve: { alias: { '@': resolve(__dirname, 'src') } }, + build: { + rollupOptions: { + output: { crossOrigin: false }, // 禁用 crossorigin,避免 helmet 无 CORS 头导致 JS 被阻止 + }, + }, server: { port: 5173, proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true } } }, })