vue - proxy代理

vue.config.js配置

devServer: {
  open: false,
  port: 8801,
  // 代理
  proxy: {
    '/user/adm/': {
      target: 'http://192.168.0.11:10001/',
      changeOrigin: true
    },
    '/baradm/adm/': {
      target: 'http://192.168.0.11:10003/',
      changeOrigin: true
    },
    '/v3/config/': {
      target: 'https://restapi.amap.com',
      secure: false, // https協議才設置
      changeOrigin: true
    }
  }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章