根据文档设置了代理参数,但访问代理后的地址认识失效!
http://jsonplaceholder.typico...
http://localhost:8080/api/pos...
config/index.js代理参数设置如下:
proxyTable: {
'/api': {
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
请求路径前面有写/吗?
例如"/api/post",最前面要写/
试一下这样? 刚在自己的demo试了可以访问
解决了吗?1