美文网首页
vue-cli 开发阶段跨域处理

vue-cli 开发阶段跨域处理

作者: 秃头大叔 | 来源:发表于2017-12-06 11:17 被阅读0次
1512529973(1).jpg
//config文件夹内index.js  dev 配置     
  proxyTable: {
      '/JydDataPlatform': {
        target: 'http://XXX.cn',
        changeOrigin: true,
        pathRewrite: {
          '^/JydDataPlatform': ''
        }
      }
    }


// 请求路径     解析的完整路径为'http://XXX.cn/JydDataPlatform/login/getVerificationCode'
that.$http.post("/JydDataPlatform/login/getVerificationCode").then(response=>{
      console.log(response);
 })

方法二 https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi Allow-Control-Allow-Origin: *插件

相关文章

网友评论

      本文标题:vue-cli 开发阶段跨域处理

      本文链接:https://www.haomeiwen.com/subject/uvekixtx.html