收藏
回答

addCard接口苹果机签名错误

调用wx.addCard接口苹果机签名错误,安卓正常领取,请问是什么原因,

let Cardarr = [];

let num =1000;

for (let i = 0; i < getApp().globalData.cardArr.length;i++){

// if (getApp().globalData.cardArr[i].isSuccess){

let time = parseInt(new Date() / 1000);

num = num + 1000 * i

let nonce_str = "xcx" + time+num;

let cardId = getApp().globalData.cardArr[i].cardId;

let str = time + getApp().globalData.cardApiTicket + cardId + nonce_str;

let signature = util.sha1(str);

arr = {

cardId: cardId,

cardExt:{"timestamp":time, "nonce_str":nonce_str ,"signature":signature}

};

Cardarr.push(arr);

// }

}

console.log(Cardarr,201)

wx.addCard({

cardList: Cardarr,

success(e) {

console.log(e);

that.receive_card(e.cardList);

that.setData({

myshowbox: 0

})

},


回答关注问题邀请回答
收藏

2 个回答

  • 2017-12-05

    签名错误,不过已经解决了

    2017-12-05
    有用
    回复
  • 2017-12-04

    具体的错误信息是什么

    2017-12-04
    有用
    回复
登录 后发表内容