diff --git a/app/Http/Controllers/Customer/AuthController.php b/app/Http/Controllers/Customer/AuthController.php index 3bbcdbe..7df8a1a 100644 --- a/app/Http/Controllers/Customer/AuthController.php +++ b/app/Http/Controllers/Customer/AuthController.php @@ -214,10 +214,18 @@ 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); +// $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); Log::channel("get_mobile_by_openid")->info($result);