关于cli3.0跨域的处理

在vue.config.js  modules export添加devservevue

devServer: {
    proxy: {
      '/baiduaa': {
        target: 'https://baidu.com', // 接口的域名
        secure: false, // 若是是https接口,须要配置这个参数
        changeOrigin: true, // 若是接口跨域,须要进行这个参数配置
        pathRewrite: {
          '^/baiduaa': ''
        }
      }
    }
  },
相关文章
相关标签/搜索