前端项目访问后端接口访问不到
淡定我咔 2020-05-15 12:23:53 前端项目访问后端项目访问不到:
前端请求地址:http://localhost:8000/api/dico-base/auth/login
前端配置文件:
proxy: {
'/api/': {
//匹配所有以/api/为开头的接口
target: 'http://192.168.1.19:8085',
//后端服务器地址
changeOrigin: true,
pathRewrite: {
'/api/': '',
}, //因为我们项目的接口前面并没有api 所以直接去掉
},
},
后端地址:http://192.168.1.19:8085/auth/login