// 配置动态代理
proxy: {
[process.env.VUE_APP_BASE_API]: {
// 代理地址 /dev-api
// target: 'https://mock.mengxuegu.com/mock/61152fcaf4bea722a4858469/blog-admin',
target: 'http://localhost:9090', // 后台接口地址
// 开启代理服务器,/dev-api/test
changeOrigin: true,
secure: false, // 使用的是http协议则设置为false,https协议则设置为true
ws: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
}
{timestamp: "2021-12-17T03:18:59.996+0000", status: 404, error: "Not Found",…}
error: "Not Found"
message: "No message available"
path: "/prod-api/sys/sysUser/login"
status: 404
timestamp: "2021-12-17T03:18:59.996+0000"
这个代理是开发环境的,如果要部署配置nginx转发