<?php $encryptData = input('encryptedData','','trim'); //小程序加密数据 $iv = input('iv','','trim'); //小程序加密方法 $sessionKey = $_SESSION['session_key']; //小程序登录session_key if (empty($_SESSION['session_key']) || empty($encrypt_data) || empty($iv)) { $this->error('请先登录', [], 500); } $aesKey = base64_decode($sessionKey); $aesIV = base64_decode($iv); $aesCipher = base64_decode($encryptData); $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV); $data = json_decode($result, true); //var_dump(data);