modify the index.js configuration request address under config or fail according to the method on the Internet
The index.js code underconfig is as follows:
proxyTable: {
"/api/**":{
target: "http://api.jisuapi.com",
changeOrigin: true,
pathRewrite:{
"^/api": ""
}
}
},
axois request code is as follows:
const actions = {
getList ({commit}, msg){
const start = Math.floor(Math.random() * 100)
if (msg.channel && msg.type && msg.flag) {
axios.get("/api/news/get?channel=" + msg.channel + "&start="+ start +"&num=10&appkey=272f8fcb40a13a6e")
.then(res =>{
commit("GET_NEWSLIT",{
data: res.data.result.list,
kind: msg.type
})
console.log(res.data)
})
}
},
the page reported an error as follows
Thank you for your answers first!