«

nuxt.js配置@nuxtjs/axios

emer 发布于 2019-10-31 16:11   2482 次阅读     


  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios'
  ],
  /*
  ** Axios module configuration
  ** See https://axios.nuxtjs.org/options
  */
 axios:{
  proxy: true,
  prefix: '/api', // it only work when proxy is enabled
  credentials: true,
},
proxy: {
  '/api': {
    target: 'http://t.weather.sojson.com/',
    changeOrigin: true,
    pathRewrite: { '^/api': '' },
  }

},