下载了官方小程序sdk,然后一直说验证失败,
dome里面的upyun-wxapp-sdk.js好像也有问题,把外面的upyun-wxapp-sdk.js替换进去了
const Upyun = require('../../utils/upyun-wxapp-sdk')
const upyun = new Upyun({
bucket: 'inxx-crm',
operator: 'imgdata2',
getSignatureUrl: 'https://tcrm.inxx.top/api/hom...'
// getSignatureUrl: 'https://tcrm.inxx.top/'
})
Page({
chooseImage: function () {
const self = this
wx.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: function (res) {
console.log('chooseImage success, temp path is', res.tempFilePaths[0])
const imageSrc = res.tempFilePaths[0]
upyun.upload({
localPath: imageSrc,
remotePath: '/wxapp/demo',
success: function (res) {
console.log('uploadImage success, res is:')
console.log(res)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 1000
})
self.setData({
imageSrc
})
},
fail: function ({errMsg}) {
console.log('uploadImage fail, errMsg is', errMsg)
}
})
},
fail: function ({errMsg}) {
console.log('chooseImage fail, err is', errMsg)
}
})
}
})
您好,麻烦您联系我们在线技术帮您排查一下http://support.upyun.com/kcha...