报错:unable to verify the first certificate
在vue3 + ts 项目中 添加了代理配置,本地测试接口请求时,出现代理报错- - - unable to verify the first certificate
报错现象如图所示:

解决方法:vite.config.ts中添加代理配置- - - secure: false
在vite.config.ts 的 proxy 代理配置中添加:secure: false
export default defineConfig({
server: {
host: '0.0.0.0'