收藏
回答

addCard接口苹果机签名错误

问题模块
API和组件

调用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

})

},


最后一次编辑于  2017-12-04
回答关注问题邀请回答
收藏

2 个回答

  • 紫日
    紫日
    2017-12-05

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

    2017-12-05
    赞同
    回复
  • Holyhulk
    Holyhulk
    2017-12-04

    具体的错误信息是什么

    2017-12-04
    赞同
    回复