代理、请求转发配置:

nuxt.config.js文件中添加:

  axios: {
    proxy: true, // 需要的,不设置请求无法转发
  },
  proxy: {
    '/api/': {
      target: 'http://127.0.0.1:9000', // 请求得对方地址
      changeOrigin: true,
    },
    '/static/': {
      target: 'http://127.0.0.1:9000',
      changeOrigin: true,
    }
  }

  

相关文章:

  • 2022-12-23
  • 2022-02-09
  • 2021-12-07
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-04-19
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2021-11-28
  • 2022-03-04
  • 2021-11-28
  • 2021-09-08
相关资源
相似解决方案