收藏
回答

云托管如何上传图片?

在本地调用上传图片的接口可以跑通。但是上传容器之后就报错(token):

{"message":"self signed certificate","name":"Error","stack":"Error: self signed certificate\n    at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)\n    at TLSSocket.emit (node:events:390:28)\n    at TLSSocket._finishInit (node:_tls_wrap:944:8)\n    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/0.26.1","Content-Length":63},"method":"post","url":"https://api.weixin.qq.com/tcb/uploadfile?access_token=56_udT1NKmhLQAQ68wfh7b0_CDWATzGuGEPWW3LQt64Z4EX5vqUmX6Kc6JkKOxYaILi6fjZCspHZOb9KXbsJBwzziGOnelJdKQbbz","data":"{\"env\":\"dream-party-7gp4oasy164\",\"path\":\"web/images6.jpg\"}"},"code":"DEPTH_ZERO_SELF_SIGNED_CERT","status":null}


如果用微信令牌也会报同样的错误(微信令牌)。

{"message":"self signed certificate","name":"Error","stack":"Error: self signed certificate\n    at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)\n    at TLSSocket.emit (node:events:390:28)\n    at TLSSocket._finishInit (node:_tls_wrap:944:8)\n    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/0.26.1","Content-Length":63},"method":"post","url":"https://api.weixin.qq.com/tcb/uploadfile","data":"{\"env\":\"dream-party-7gp4oasy1647b3f1\",\"path\":\"web/images6.jpg\"}"},"code":"DEPTH_ZERO_SELF_SIGNED_CERT","status":null}


最后一次编辑于  2022-04-22
回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容