Commit efe9047c by kaisa

feat:更新

parent d5b4a74a
Showing with 8 additions and 0 deletions
......@@ -43,11 +43,18 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
host: "0.0.0.0",
port: +env.VITE_APP_PORT,
open: true,
cors: true,
headers: {
'Access-Control-Allow-Origin': '*', // 允许所有来源
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
},
proxy: {
// 代理 /api 的请求
[env.VITE_APP_BASE_API]: {
changeOrigin: true,
target: env.VITE_APP_API_URL,
secure: false,
rewrite: (path) =>
path.replace(/^\/api/, ""),
},
......@@ -55,6 +62,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
changeOrigin: true,
target: env.VITE_APP_WS_URL,
ws: true,
secure: false,
},
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment