1、别名:vue4.0 的 @ 别名已经配置好了,代表的是 src 文件夹,可直接使用。
2、怎么配置 proxytable 代理?
// 正确
proxy: {
'/app': {
target: 'http://122.152.200.208:9010',
changeOrigin: true,
pathRewrite: { '^/': '/' },
},
},
// 错误
proxy: {
'/app': {
target: 'http://122.152.200.208:9010/app',
changeOrigin: true,
pathRewrite: { '^/': '/' },
},
},
// 错误
proxy: {
'/app': {
target: 'http://122.152.200.208:9010',
changeOrigin: true,
pathRewrite: { '^/app': '/' },
},
},
以上三种方式代理的结果在network中查看都是这个结果:
http://localhost:8000/app/rest/user/userList,但只有第一个能获取到数据