From c1bc58de8d24e17a133f502b5d2a607fefd97289 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 26 Nov 2019 16:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/libs/wechat/weapp.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/libs/wechat/weapp.rb b/app/libs/wechat/weapp.rb index ca356b28d..cbf26efd2 100644 --- a/app/libs/wechat/weapp.rb +++ b/app/libs/wechat/weapp.rb @@ -22,8 +22,8 @@ class Wechat::Weapp end def decrypt(session_key, encrypted_data, iv) - session_key = Base64.decode64(session_key) - encrypted_data = Base64.decode64(encrypted_data) + session_key = Base64.decode64(session_key).force_encoding("utf-8") + encrypted_data = Base64.decode64(encrypted_data).force_encoding("utf-8") iv = Base64.decode64(iv) cipher = OpenSSL::Cipher::AES.new(128, :CBC)