https://developers.weixin.qq.com/miniprogram/dev/extended/service-market/api.html
小程序由于需要加上图片安全检测,使用了珊瑚图片安全服务,但是小程序本身的设计是离线的不存储用户的图片,所以使用了CDN接口,在开发者工具(v1.03.2004262)上进行同一图片的安全检测时出现了下一情况,真机没有出现,因为有点担心所有想问一下是开发者工具的问题还是以后会有其他的限制
调用方式
wx.serviceMarket.invokeService({
service: serviceId,
api: 'imgSecCheck',
data: {
Action: "ImageModeration",
Scenes: ["PORN", "POLITICS", "TERRORISM", "TEXT"],
ImageUrl: new wx.serviceMarket.CDN({
type: 'filePath',
filePath,
}),
Config: "",
Extra: "",
},
})
请求信息
Request URL: http://wx.serviceMarket.invokeService
Request Method: POST
Status Code: 200 OK
Request Payload
{
"service": serviceId,
"api": "imgSecCheck",
"data": {
"Action": "ImageModeration",
"Scenes": [
"PORN",
"POLITICS",
"TERRORISM",
"TEXT"
],
"ImageUrl": "http://vweixinf.tc.qq.com/301/20303/stodownload?m=2c29ec73d2211c05cb32af8854fa9b57&filekey=30350201010421301f0202012d0402534804102c29ec73d2211c05cb32af8854fa9b570203045826040d00000004627466730000000131&hy=SH&storeid=323032303035303930323038313030303063316239363733356162303563376365353466303930303030303132643030303034663466&bizid=1023",
"Config": "",
"Extra": ""
},
"clientMsgId": "0.12045043433951652_1589083913457"
}
Response
{"errMsg":"wx.serviceMarket.invokeService:ok","data":"{\"Response\":{\"Error\":{\"Code\":\"FailedOperation.DownLoadError\",\"Message\":\"文件下载失败\"},\"RequestId\":\"f0a9cad9-125d-433b-a944-625fd12e6d8f\"}}"}
我也遇到这个问题
文件下载的失败的问题解决了吗?