1.aa.vue
import axios from 'axios'
axios.get("/goods").then((response)=>{
let res=response.data;
if(res.status=="0"){
this.goodsList=res.result;
}else{
this.goodsList=[]
}
})
2. axios不支持跨域 node写的接口地址是localhost:3000
所以需要修改config/index.js问题来解决跨域问题
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/goods':{
target:'http://localhost:3000'
}
},