signature calculated is different from
遇到一个问题,是在云函数端的错误。
代码是这样的,在云函数端更改一个数据记录。
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;
签名和客户端不同
因为是在云函数端,也不存在权限问题吧。很是不解。
有没有大神帮忙看一下子,万分感谢。