|
api.download下载https协议的pdf,不成功
代码如下:
api.download({
url: path,
savePath: fileDir + Date.now() + ".pdf",
report: true,
cache: true,
allowResume: true
}, function(ret, err) {
console.log('--------------path------'+JSON.stringify(path))
console.log('`````````'+JSON.stringify(ret));
});
其中fileDir是:
var fileDir= "fs://procurement/";//本地文件根目录
ret的返回结果:
````````{"state":2,"fileSize":0,"percent":0,"progress":0,"msg":"连接错误,请检查网络或者请求配置是否正确","statusCode":0}
path是以https开头的pdf文档地址,可以在浏览器下载。
|
|