1、安装@gauseen/nuxt-proxy包依赖

cnpm install @gauseen/nuxt-proxy --save

2.设置nuxt.config.js

修改modules为
modules: [
    "@gauseen/nuxt-proxy"
]

3.增加 proxyTable属性

proxyTable: {
    "/api": {
        target: 'https://xxxxx.com',
        changeOrigin: true,
        ws: false,
        pathRewrite: {
           "^/api": "/api"
        }
    }
}

 

 

 

 

相关文章:

  • 2021-06-08
  • 2021-11-20
  • 2021-04-02
  • 2022-01-17
  • 2022-12-23
  • 2022-02-08
猜你喜欢
  • 2021-08-29
  • 2021-10-03
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案