up. 双向数据加密

This commit is contained in:
u2nyakim 2025-08-29 16:10:39 +08:00
parent 99e5d3848e
commit 03576fdac6

View File

@ -128,7 +128,7 @@ abstract class BaseController
* @param mixed $data
* @return Json
*/
protected function writeJson(int $code = 200, string $message = '', mixed $data = null): Json
protected function writeJson(int $code = 200, string $message = '', mixed $data = null, $skipEncryption = false): Json
{
if($data instanceof Paginator) {
$data = [
@ -142,6 +142,9 @@ abstract class BaseController
"data" => $data,
"message" => $message,
);
if ($skipEncryption) {
return json($result);
}
$resultEncrypted = [
'encryptedData' => \app\Request::encryptCryptoJSAES($result)
];