解决VUE跨域问题
文章目录
vue项目根目录新建vue.config.js文件:
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
}
}其他接口调用
//加上/api 地址指向到 http://localhost:8000、system/slider/list/
/api/system/slider/list/
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论