收藏
回答

同城配送接口返回值解密为什么会有成功与失败并存?

https://api.weixin.qq.com/cgi-bin/express/intracity/querystore 接口 同样的参数请求了四次返回了如下四次结果:

apiResp {

  resp_ts: 1697583469,

  resp_data: '{"iv":"poUSBP9ljDrs4S0Y","data":"tnSMq13wZE/f4KmImCcScgl2zSwIV1IWph+9evYeXz003vraSkepSc7pbjYx+ETrlqL6ow1nPuHDwxkYSlQ7MfMSN/lHstCskbCSOOYsNqSA10TnlnZfwmSJXMUm6JhpAeMVO1kb9EyKrn6PAX88nr0ZR4XxUX2b7gbUsUa7UKWiVAcLZXhZhrbHy/MNGDwWSp1Ox7odr2PbgA5CJ4FHF2FEvW8nUh7wg3p2kq2LsoJiE4MI5WfTNcMzuVu1sCwCo4mrHCzFxJJd2YohJIxGXQgYAbZKlwljcT3Y5WriF2IugFKdPj/TfEs4KKiZg7+5yiqM3H6W5gN9aI3FYeDEZ9eh2Po1tUHfb0CtaEYPMQvMUFhSZ9iT8U7OgGSg4+vcM7gx0yVr8/HjqFxam6PnQm9jZWQVmn5pd3S0wxQ1fTOo0r9rmEyqdAYPYN5GxqXraLBELBvE6uhPjJvCySR1d5PIYOzQwP9HYSSxnn8l4cxBQ1cWnclTrPS8ioE0ixd6uQf9GFBv/TzNKdxA2idMJ72z96mIDmGF2PKMJv4/uwFQrSX257IgFptqS3NsghgiGxFxnsCMoAxQC4KdlnYJyR+ngOg+zPOi","authtag":"d0f2BWmdHp4dtuS44DsQPg=="}'

}

apiResp {

  resp_ts: 1697583580,

  resp_data: '{"iv":"Rz2AW/rG+4n9u8ha","data":"bZWKlpzhASH2ucvsVopWaKmsLt47UY2HThqL1PwIuNvhtYO/BLH/6//LVGjeePVJ9zsaBVlM1uzlwCC9oqDCV7mP9npe+/zUa3n6/KgHHqFD9Hy1P2V8dw9UJQpOCEgXEkF0Yhn8UpqYX35aTvl/am4XVg3tPtnYvbhHH3C9TDQToC9FnS9B+iGmNMugBJ2UrPkbnOZWdDlOmbos4GsHcFS0f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JTqP6LvlMOg3rWaSkpu","authtag":"a1xyfwbJ4pCf+ScUKUafgg=="}'

}

apiResp {

  resp_ts: 1697583597,

  resp_data: '{"iv":"GFMKzyml/04NGIix","data":"iRUDngbf8/vGEl4rPHr+aX0MhwTfApA9Upvw429VPA8Mh3unBDmYX5+8l/PYtrBnO0s4476IB6stTuCxVNpqRfwXvUQZP0T6KfPPLicFO7BjYeBWTo8Veqdy86+qFc7NzQ4Ng63g11YKd55DSViy+qQCEW9hYOtpCi9s6mnAo2g1rRNIXMva6PvHKJUFwgYtJLEh64w9FP0NNqlNM7BtMLAxE6Kxf5FIkXJWV3UplQb5TA5WYrxdyi0mKqV998+OyF2CoxGSVtQ+0FMy91N9tbwE7OCIsjknE6P7tfFk9zcge/2r9na6xlqOsKQTsj22BsMWHV3wOz8v94ZFkWa6B8X4B0Te4W+FyIKRw5Fv0z10gGJnJjkTN7hb1i3rJTU28ioTPEVKMwI7fL1SKuo5K5zCnN/E4o6QaZZ6ldhyL8bUOyRa/FqiA2WvBkD8TpdXpGRjvruakuEq96BeqqwzeCjLoVcu8XW2tpwHfmJnG9j87toqYEF7xurr+S0EG0QcDQQsag7KjnptMglwZ46yKUJAyHIQXFvIRu328XBnDsbrH3ByvieBUCvwrDBnsX7vf8VwF9ke6RUKECakY+J1UKgcinrsJPWq","authtag":"BbwoRTp2PqZf5RdMzwaXuw=="}'

}

https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/getting_started/api_signature.html 然后按照官方node.js的解密方式解密,其中只有第一与第四个结果是解密成功的,第二第三都提示【auth tag验证失败】,这结果预期根本没办法做业务逻辑,而且查运费接口返回的结果是百分之百解密失败的。有解决办法吗这种情况。

回答关注问题邀请回答
收藏

2 个回答

  • 子非鱼丶
    子非鱼丶
    2023-10-23

    试下拿response返回的header中的时间戳进行解密

    2023-10-23
    有用 1
    回复
  • 鱼
    02-02

    这个问题我们也遇到了 很奇怪 有人能解答吗? 我们时间戳请求头,请求体,解密对应时间戳都是一样,现在这个问题很影响我们正常开发

    02-02
    有用
    回复 1
登录 后发表内容