wx.addCard 的问题

发布于 7 年前作者 liwang17461 次浏览最后编辑 7 年前来自 ask

signature 生成的跟工具上测试的是一样的,为什么还是签名错误呢

lingka:function(){

wx.request({

url: app.d.ceshiUrl+‘/Api/Api/suiji’,

method: ‘post’,

data: {

},

header: {

‘Content-Type’: ‘application/x-www-form-urlencoded’

},

success: function (res) {

console.log(res)

var time = JSON.stringify(res.data.time);

var str = JSON.stringify(res.data.success);

console.log(str)

console.log(time)

wx.addCard({

cardList: [

{

cardId: ‘pRYCp0yeF36-CY1CxF6eQq5BdBnI’,

cardExt: ‘{“code”: “”, “openid”:“”, “timestamp”: ‘ + time + ’, “signature”:’ + str+ ‘}’

}

],

success: function (res) {

console.log(res) // 卡券添加结果

}

})

}

})

}

 前端代码哪里错了吗

7 回复
junchen
junchen1 楼6 年前

请检查timestamp 是否正确,是到秒,不是毫秒

yongqian
yongqian2 楼6 年前

解决了吗?我也碰到了 

motao
motao3 楼6 年前

看了很多文档,依然是签名错误,不知道怎么解决,

xia18
xia184 楼6 年前

解决了嘛?

myi
myi5 楼6 年前

我当时是少一个随机字符串,希望能帮到你

gang50
gang506 楼6 年前

一直签名错误

tiantao
tiantao7 楼5 年前

解决了吗?我也碰到了