vite+vue3使用localhost访问接口报错 500

vite+vue3使用localhost访问接口报错 500

用ip访问这个接口是可以通的 但是用localhost访问就报500或者200但不返回东西,原因就是代理少了个配置 secure: false, // 跳过https验证

"/api": {
        target: "https://aaaaaa", // 
        secure: false, // 跳过https验证
        rewrite: (path) => path.replace(/^\/api/, ""),
      },

在这里Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:*.qhfct.com, DNS:qhfct.com插入图片描述
报的错是这个
Hostname/IP does not match certificate’s altnames: Host: localhost. is not in the cert’s altnames: DNS:*.qhfct.com, DNS:qhfct.com

你可能感兴趣的:(vue.js)