fix: 兼容加密bug问题处理

This commit is contained in:
weifashi 2023-06-05 19:03:57 +08:00
parent 20496b2edb
commit edfb32647b

View File

@ -52,9 +52,10 @@ class WebApi
// 加密返回内容
if ($encrypt['client_type'] === 'pgp' && $content = $response->getContent()) {
$response->setContent(json_encode([
'encrypted' => Doo::pgpEncryptApi($content, $encrypt['client_key'])
]));
$content = Doo::pgpEncryptApi($content, $encrypt['client_key']);
if($content){
$response->setContent(json_encode([ 'encrypted' => $content ]));
}
}
return $response;