up. 双向数据加密
This commit is contained in:
parent
99e5d3848e
commit
03576fdac6
@ -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)
|
||||
];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user