微信小程序解密 TypeError(the JSON obje
2018-06-21 本文已影响0人
Yeureka
在微信小程序解密过程中,使用官方 python 示例出现编码问题
TypeError: the JSON object must be str, not 'bytes'
解决方法为:
decrypted = json.loads(self._unpad(cipher.decrypt(encryptedData)))
改为
decrypted = json.loads(str(self._unpad(cipher.decrypt(encryptedData)), encoding='utf-8'))