zxx_im 0.3.8 copy "zxx_im: ^0.3.8" to clipboard
zxx_im: ^0.3.8 copied to clipboard

An instant messaging IM-flutter plug-in that interfaces with Tencent Cloud

License

const uploadFileGroup = (arr) => {
wx.showLoading({
title: '加载中',
mask: true
})
let token = ''
if (getStorageSync('registerInfo')) {
token = getStorageSync('registerInfo').token
}
let newA = []
let num = 0
return new Promise((resolve, reject) => {
wx.request({
url: 'https://platform.i51c.com/dcs/api/fc/applyTokenForQiNiuUpload',
method: "GET",
header: {
token,
'Content-Type': 'application/json'
},
success: function(upToken) {
const options = {
region: 'SCN',
// uploadURL: 'https://up-z2.qiniup.com',
uploadURL: 'https://7nupload.i51c.com',
domain: 'https://7n.7linkshop.com',
uptoken: upToken.data.data
}
arr.forEach(item => {
qiniuUploader.upload(item, (res) => {
num += 1
newA.push(res.imageURL)
if (num == arr.length) { // 因为只能单张上传
resolve(newA.join(','))
wx.hideLoading()
}
}, (err) => {
reject(err)
wx.hideLoading()
}, options)
})
},
fail: function() {
reject('上传失败')
wx.hideLoading()
}
});
})
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

An instant messaging IM-flutter plug-in that interfaces with Tencent Cloud

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on zxx_im