修改音视频签名
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user