鍍金池/ 問答/HTML/ vue proxyTable無法解決跨域

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)
回答
編輯回答
葬憶
let URL = "/api/mock/33a3028a1c490faf003f2b6196f2cc92/dksq"
  this.$http.get(URL).then(
        function (res) {
            console.log(res.body);
        },function (res) {
            console.log('error')
        }
    );
2017年7月13日 05:20