我使用springboot写了一个后端的登录接口,将接口请求地址修改成了https://localhost:8090/,修改如下:
devServer: {
// 配置反向代理
proxy: {
// 当地址中有/api的时候会触发代理机制
'/api': {
// 要代理的服务器地址 这里不用写 api
// target: 'https://api.imooc-admin.lgdsunday.club/',
target: 'https://localhost:8090/',
changeOrigin: true // 是否跨域
}
}
},
前端不能请求8090端口,出现错误如下:


基于Vue3重写Vue-element-admin,打造后台前端综合解决方案
了解课程