Commit 1881dbadb047e2cccb196e44716a9a42d33c97c5
1 parent
4f32bba1
build(nuxt): 修改 API 代理配置
- 将线上的 API 代理地址注释掉 - 恢复使用本地地址 http://127.0.0.1:8002/shop
Showing
1 changed file
with
4 additions
and
4 deletions
nuxt.config.ts
@@ -32,8 +32,8 @@ export default defineNuxtConfig({ | @@ -32,8 +32,8 @@ export default defineNuxtConfig({ | ||
32 | nitro: { | 32 | nitro: { |
33 | devProxy: { | 33 | devProxy: { |
34 | "/shop": { | 34 | "/shop": { |
35 | - target: "http://47.89.254.121:8002/shop", // 线上代理地址 | ||
36 | - //target: "http://127.0.0.1:8002/shop", | 35 | + //target: "http://47.89.254.121:8002/shop", // 线上代理地址 |
36 | + target: "http://127.0.0.1:8002/shop", | ||
37 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 | 37 | // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名 |
38 | changeOrigin: true, // 表示是否跨域 | 38 | changeOrigin: true, // 表示是否跨域 |
39 | }, | 39 | }, |
@@ -41,8 +41,8 @@ export default defineNuxtConfig({ | @@ -41,8 +41,8 @@ export default defineNuxtConfig({ | ||
41 | // 该配置用于服务端请求转发 | 41 | // 该配置用于服务端请求转发 |
42 | routeRules: { | 42 | routeRules: { |
43 | "/shop/**": { | 43 | "/shop/**": { |
44 | - proxy: "http://47.89.254.121:8002/shop/**", | ||
45 | - //proxy: "http://127.0.0.1:8002/shop/**", | 44 | + //proxy: "http://47.89.254.121:8002/shop/**", |
45 | + proxy: "http://127.0.0.1:8002/shop/**", | ||
46 | // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**' | 46 | // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**' |
47 | }, | 47 | }, |
48 | }, | 48 | }, |