没有在入口文件配置axios.defaults.baseURL
只做了下面的配置
但是提示GET http://localhost:8080/api/movie/top250?start=25&count=25 404 (Not Found)
这是为什么?
config下的index.js
proxyTable: {
'/api': {
target: 'http://api.douban.com/v2/',
changeOrigin: true,
pathRewrite: {
'^/api': '/'
}
}
},
import axios from 'axios'
mounted () {
axios.get('/api/movie/top250?start=25&count=25').then(res => {
console.log(res)
})
}
配置这样写,没问题之后,重新运行项目。

