vue proxyTable无法解决跨域

proxyTable: {

  '/api': {
    target: 'http://dsn.apizza.cc',
    changeOrigin: true,
    pathRewrite: {
      '^/api': ''
    }
  }
},


============
let URL = "/mock/33a3028a1c490faf003f2b6196f2cc92/dksq"
  this.$http.get(URL).then(
        function (res) {
            console.log(res.body);
        },function (res) {
            console.log('error')
        }
    );

========================

    vue-resource.es2015.js?3916:1085 GET http://localhost:8080/mock/33a3028a1c490faf003f2b6196f2cc92/dksq 404 (Not Found)
阅读 2.6k
1 个回答
let URL = "/api/mock/33a3028a1c490faf003f2b6196f2cc92/dksq"
  this.$http.get(URL).then(
        function (res) {
            console.log(res.body);
        },function (res) {
            console.log('error')
        }
    );
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏