Skip to main content

文件上传

chooseImage

七牛图片上传参数说明

属性类型默认值是否必填描述
localFilePathsstring[]本地图片地址数组
tokenstring七牛上传凭证token
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

示例代码

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"
}