From 794721f3f0ba6f2a7736689a6daa64e94c52bf44 Mon Sep 17 00:00:00 2001 From: luyisha Date: Wed, 26 Jul 2023 11:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=9F=9F=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/config.js | 1 + src/config/public.js | 1 + vue.config.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/config.js b/public/config.js index d1bdd07..357dd53 100644 --- a/public/config.js +++ b/public/config.js @@ -1,4 +1,5 @@ window.publicConfig = { // 请求地址 BASE_API:'http://btgym.xingtongworld.com/index.php?s=/api/', + // BASE_API:'http://192.168.66.16/index.php?s=/api/', } \ No newline at end of file diff --git a/src/config/public.js b/src/config/public.js index 5c07404..5046089 100644 --- a/src/config/public.js +++ b/src/config/public.js @@ -2,4 +2,5 @@ window.publicConfig = { // 请求地址 BASE_API: 'http://btgym.xingtongworld.com/index.php?s=/api/', + // BASE_API: 'http://192.168.66.16/index.php?s=/api/', } \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index bb99f7e..80999b2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,7 +7,8 @@ module.exports = defineConfig({ devServer: { proxy: { '/api': { - target: 'http://btgym.xingtongworld.com/api/', // 配置访问的服务器地址 + // target: 'http://btgym.xingtongworld.com/api/', // 配置访问的服务器地址 + target: 'http://192.168.66.16/api/', // 配置访问的服务器地址 pathRewrite: { '^/api': '' }, // 用于将请求中的 /api 字符串替换为空, 然后访问地址就能正确访问,若不添加此行配置,那么访问地址就变成了: http://localhost:5000/api/request_url,这样的请求就会出现 404 操作 ws: true, // 是否支持 webstocket, 默认是 true changeOrigin: true // 用于控制请求头中的 host 值, 默认是 ture