关于cli3.0跨域的处理

在vue.config.js  modules export添加devserve

devServer: {
    proxy: {
      '/baiduaa': {
        target: 'https://baidu.com', // 接口的域名
        secure: false, // 如果是https接口,需要配置这个参数
        changeOrigin: true, // 如果换源,需要进行这个参数配置
     ws:true, //websocket
pathRewrite: { '^/baiduaa': '' } } } },
原文地址:https://www.cnblogs.com/gao-xiaomeng/p/11224978.html