使用vite + vue3 搭建开发环境 接口请求代理https报错解决方案
文章目录
17:58:50 [vite] http proxy error at /**/detail?userId=1:
Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1550:34)
at TLSSocket.emit (node:events:514:28)
at TLSSocket._finishInit (node:_tls_wrap:967:8)
at ssl.onhandshakedone (node:_tls_wrap:743:12)vite配置写法为
{
...
server: {
proxy: {
'/api': {
secure: false, // 添加本行内容修复错误
target: 'https://**.cn',
// }
}
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论