signature calculated is different from

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

遇到一个问题,是在云函数端的错误。


代码是这样的,在云函数端更改一个数据记录。

var  handleGoods =function(goods,storenum){
  var _ = db.command;
 return db.collection('goods').doc(goods._id).update({
    data:{
      store_num:_.inc(storenum*-1),
      sale_num:_.inc(storenum)
    }
  });
}

结果是

Error: errCode: -501001 resource system error | errMsg: signature calculated is different from client signature;
    at new CloudSDKError (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/wx-server-sdk/index.js:4332:28)
    at Object.returnAsCloudSDKError (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/wx-server-sdk/index.js:4384:16)
    at Object.checkError (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/wx-server-sdk/index.js:1401:23)
    at DocumentReference.<anonymous> (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/wx-server-sdk/index.js:1334:41)
    at step (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/tslib/tslib.js:133:27)
    at Object.next (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/tslib/tslib.js:114:57)
    at fulfilled (/Users/skymxc/Documents/project/WeChat/shop/cloudfunctions/handleOrder/node_modules/tslib/tslib.js:104:62)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

返回的错误是 signature calculated is different from client signature; 签名和客户端不同
因为是在云函数端,也不存在权限问题吧。很是不解。

有没有大神帮忙看一下子,万分感谢。

6 回复
wei07
wei071 楼6 年前

我也是碰到了

lujie
lujie2 楼6 年前

今天第一次碰到,不知道怎么办了

nading
nading3 楼6 年前

+1

xiuying68
xiuying684 楼6 年前

解决了吗?同遇

taodeng
taodeng5 楼6 年前

这个怎么没人回答呢

nma
nma6 楼6 年前

我也碰到了,有解决方案没?兄弟们