修改音视频签名

This commit is contained in:
wucongxing 2024-02-02 15:45:12 +08:00
parent 893ec62df6
commit ca2d5e4d5a
3 changed files with 7 additions and 14 deletions

View File

@ -93,7 +93,7 @@ class VideoService extends BaseService
$params['order_inquiry_id'] = $order_inquiry_id;
$video_records = VideoRecord::getOne($params);
if (!empty($video_records)) {
return fail(HttpEnumCode::HTTP_ERROR, "已开过视频时间,无需再修改预约时间");
return fail(HttpEnumCode::HTTP_ERROR, "已开过视频,无需再修改预约时间");
}
$is_reservation = true;

View File

@ -737,11 +737,7 @@ Router::addGroup('/callback', function () {
Router::post('/im', [CallBackController::class, 'imCallBack']);
// 音视频回调
Router::addGroup('/trtc', function () {
// 房间
Router::post('', [CallBackController::class, 'trtcCallBack']);
});
Router::post('/trtc', [CallBackController::class, 'trtcCallBack']);
// 处方平台物流回调
Router::post('/platform/logistics', [CallBackController::class, 'platformLogisticsCallBack']);

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;
}