采用vue-cli構建項目,接口轉發如下proxyTable: { '/api': { target: 'http://abcd.com/api', changeOrigin: true, pathRewrite: { '^/api': '' } } }在開發環境下,配置了這個,可以解決在開發環境下的跨域請求,那么在生產環境下 通過 npm run build打包之后,這一塊的問題vue-cli會自己處理嗎?在生產環境下還需要注意什么東西?求大神解答axios.post('api/auth/register', { 'firstname':this.firstname, 'lastname':this.lastname, 'email':this.email, 'password':this.password, 'password_confirmation':this.configPassword }) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); });假設請求如上api(生產環境沒有跨域),在本地配置接口轉發之后可以請求到數據,那么在生產環境應該要怎么樣?直接打包之后,將資源放在服務器嗎?
vue-cli 本地接口轉發
慕森王
2018-11-07 14:15:12