修改音视频签名

This commit is contained in:
2024-02-02 15:45:12 +08:00
parent 893ec62df6
commit ca2d5e4d5a
3 changed files with 7 additions and 14 deletions
+5 -8
View File
@@ -24,18 +24,15 @@ class Safe extends Base
*/
public function validateSign(string $body, string $sign): bool
{
// $token = config('video.token');
// if (empty($token)) {
// throw new BusinessException("Video Token Config Error");
// }
// dump($token);
$token = config('video.token');
if (empty($token)) {
throw new BusinessException("Video Token Config Error");
}
$hash = hash_hmac( 'sha256', $body, "NDc5MzExMDIYdusl2NDMxNDg5L", true );
$hash = hash_hmac( 'sha256', $body, $token, true );
$sys_sign = base64_encode($hash);
dump($sign);
dump($sys_sign);
if ($sign != $sys_sign) {
return false;
}