鍍金池/ 問答/HTML/ vue-axios 請(qǐng)求接口失敗

vue-axios 請(qǐng)求接口失敗

this.axios.post('help/liushui').then((response) => {
    console.log(response)
  }).catch((response) => {
    console.log(response)
  })

這么請(qǐng)求的出錯(cuò)了
config/index.js

proxyTable: {
      '/apidomain': {
        target: 'http://www.xxx.com', // 或ip或域名。
        changeOrigin: true,
        pathRewrite: {
          '^/apidomain': ''
        }
      }
    }

報(bào)這個(gè)錯(cuò)誤了

POST http://localhost:8080/help/liushui 404 (Not Found)
回答
編輯回答
命于你

跨域了,請(qǐng)求的地址不允許來自'http://localhost:8080'的請(qǐng)求

2017年2月9日 01:04
編輯回答
忠妾

跨域問題可參考:https://segmentfault.com/a/11...

2017年7月6日 20:45