文件上传
chooseImage
七牛图片上传参数说明
| 属性 | 类型 | 默认值 | 是否必填 | 描述 |
|---|---|---|---|---|
localFilePaths | string[] | 是 | 本地图片地址数组 | |
token | string | 是 | 七牛上传凭证token | |
success | function | 是 | 接口调用成功的回调函数 | |
fail | function | 否 | 接口调用失败的回调函数 | |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例代码
dsBridge.call(
'uploadFile2Qiniu',
{
localFilePaths: [
"https://localfiles/img_20210810100701.jpg",
"https://localfiles/img_20210810100702.jpg",
"https://localfiles/img_20210810100703.jpg"
],
success (res) {
// 参照返回结果示例
}
}
)
返回结果示例
{
"code":1,
"data":{
"urls":[
"http://files-dev.for1688.cn/ios_e2b374bd7a97430c90d9744e31656aa4.jpg",
"http://files-dev.for1688.cn/ios_0fb9679049844f2795b5678b03081734.png",
"http://files-dev.for1688.cn/ios_0fb9679049844f2795b5678b03081734.png"
]
},
"msg":"success"
}