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', 
              // }
          }
      }
}

韩万慧
12 声望0 粉丝