From 5f17008d277daeb02edff8c205db954d84abacc7 Mon Sep 17 00:00:00 2001 From: liyinglin Date: Fri, 10 May 2024 13:34:56 +0800 Subject: [PATCH] 1 --- app/Http/Controllers/Customer/AuthController.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Customer/AuthController.php b/app/Http/Controllers/Customer/AuthController.php index 7df8a1a..3bbcdbe 100644 --- a/app/Http/Controllers/Customer/AuthController.php +++ b/app/Http/Controllers/Customer/AuthController.php @@ -214,18 +214,10 @@ class AuthController extends Controller $sessionKey = request()->sessionKey; $iv = request()->iv; -// $aesKey = base64_decode($sessionKey); -// $aesIV = base64_decode($iv); -// $aesCipher = base64_decode($encryptedData); -// $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV); - - $config = [ - 'app_id' => $this->appid, - 'secret' => $this->appsecret - ]; - $app = Factory::miniProgram($config); - $result = $app->encryptor->decryptData($sessionKey, $iv, $encryptedData); - dd($result); + $aesKey = base64_decode($sessionKey); + $aesIV = base64_decode($iv); + $aesCipher = base64_decode($encryptedData); + $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV); Log::channel("get_mobile_by_openid")->info($result);