- HTTP API上传图片问题?
app.post("/uploadfile", upload.single("file"), (req, res) => { var file =req.file promise.then(data => { url = 'https://api.weixin.qq.com/tcb/uploadfile?access_token=' + JSON.parse(data).access_token data = { "env": 'laoqi-2gvugolvf7a76b77', "path": 'demo/'+ file.originalname } getData(url, data).then(dataa => { var res = dataa if (res.errmsg == 'ok') { requestData = { 'key': 'demo/'+ file.originalname, 'Signature': res['authorization'], 'x-cos-security-token': res['token'], 'x-cos-meta-fileid': res['cos_file_id'], 'file':{ value:fs.createReadStream(file.path), options:{ 'filename': file.originalname, 'contentType': file.mimetype } } } getData(res['url'], requestData).then(data2 => { console.log(data2) // res.send(data2) }).catch(err => { console.log(err) res.send(err) }) } }).catch(err => { console.log(err) res.send(err) }) }).catch(data => { console.log(data); }) }) 一直报错 <?xml version='1.0' encoding='utf-8' ?> <Error> <Code>MethodNotAllowed</Code> <Message>The specified method is not allowed against this resource.</Message> <Resource>cos.ap-shanghai.myqcloud.com/6c61-laoqi-2gvugolvf7a76b77-1304583758/demo/QQ图片20200711091851.jpg</Res ource> <RequestId>NWZlOTdkYzBfN2QzZjIyMDlfODQyYl8xY2RiY2Zj</RequestId> <TraceId>OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1NmI1M2E2MTRlY2MzZDhmNmI5MWI1OTczMmZiNDZmZjBmNTV jMGU4NTViNDhhYWVjNzNkNzI4NWM1YTFlYWZiODhiYTgwMjZhMzcyMjBmNWVlZTMzNjI=</TraceId> </Error>
2020-12-28 - 使用echarts在真机调式时报错?
echarts报错[图片]
2020-11-13