小程序sdk一直报signature error

新手上路,请多包涵

下载了官方小程序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)
  }
})

}
})

阅读 4.1k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
又拍云问答
子站问答
访问
宣传栏