From b5c1614fe473330ceca8b7cff0f1802e19bd5039 Mon Sep 17 00:00:00 2001 From: Sanakey <714737083@qq.com> Date: 星期一, 30 九月 2024 13:39:08 +0800 Subject: [PATCH] feat:添加部分线索接口,完善客户相关页面 --- vite.config.ts | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index c72d423..fe823e1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -15,12 +15,18 @@ ], }, server: { + proxy: { '/basic-api': { - target: 'http://localhost:3000', + target: 'http://yingchen.onbus.cn:9010', changeOrigin: true, ws: true, rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''), + bypass(req, res, options: any) { + const proxyURL = options.target + options.rewrite(req.url); + console.log("瀹㈡埛绔姹傜殑鐪熸鍦板潃锛�", proxyURL); + res.setHeader("REAL-URL", proxyURL); // 璁剧疆鍝嶅簲澶村湪娴忚鍣ㄤ腑鍙 + } // only https // secure: false }, @@ -30,11 +36,12 @@ ws: true, rewrite: (path) => path.replace(new RegExp(`^/upload`), ''), }, + }, open: true, // 椤圭洰鍚姩鍚庯紝鑷姩鎵撳紑 warmup: { clientFiles: ['./index.html', './src/{views,components}/*'], - }, + } }, }, }); -- Gitblit v1.8.0