http://www.reibang.com/p/4eecd628782a
1盅称、安裝cnpm時出現沒有權限的情況
vim ~/.npm-config
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source~/.npm-config
2、使用axios發(fā)送http請求裹匙,跨域問題
在config/index.js的proxyTable中添加
proxyTable: {
'/job': {
target: 'http://ip:端口號/',
changeOrigin: true,
pathRewrite: {
'^/job': ''
},
}
}
并在請求時
axios({
method: 'get',
baseURL: '/job/projects.json'
}).then(res => {
this.projects = res
console.log(res)
})