Commit 26d5934a95ce2015ad11340c0e4333b53258d60f

Authored by 曾国涛
1 parent d3df9860

refactor(nuxt): 更新开发代理和路由规则

- 注释掉线上代理地址
- 使用本地代理地址
- 删除多余的路径通配符
Showing 1 changed file with 4 additions and 4 deletions

Too many changes to show.

To preserve performance only 1 of 2 files are displayed.

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 },