signature calculated is different from
发布于 6 年前 作者 gangli 7330 次浏览 来自 问答

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


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

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 回复

我也是碰到了

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

解决了吗?同遇

这个怎么没人回答呢

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

回到顶部