From c15161979783a1ad63aa331cc358eddc7bee0dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=87=E6=B7=BC=EF=BC=88piexlmax?= Date: Tue, 21 Sep 2021 16:30:40 +0800 Subject: [PATCH] Update vite.config.js --- web/vite.config.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/vite.config.js b/web/vite.config.js index 5703f495..1787f490 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -50,8 +50,7 @@ export default ({ // 把key的路径代理到target位置 // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VITE_BASE_API]: { // 需要代理的路径 例如 '/api' - // target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径 - target: `https://demo.gin-vue-admin.com/api/`, // 代理到 目标路径 + target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径 changeOrigin: true, rewrite: path => path.replace(new RegExp('^' + process.env.VITE_BASE_API), ''), } @@ -81,4 +80,4 @@ export default ({ } }, } -} \ No newline at end of file +}