From 47adcda0181044d1e15e5d580c18aaa3c74269b5 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Tue, 3 Jun 2025 17:00:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/Logic/NoticeLogic.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/application/common/Logic/NoticeLogic.php b/application/common/Logic/NoticeLogic.php index d6cb024..8f95ad4 100644 --- a/application/common/Logic/NoticeLogic.php +++ b/application/common/Logic/NoticeLogic.php @@ -51,18 +51,25 @@ class NoticeLogic $log->status = -1; $log->content = 'TTSID为空'; $log->save(); + return; } - $reponse = DyvmsService::getInstance()->call($dispatch->worker_tel, $ttsCode, md5(time())); + $status = config('alibaba_dyvms.status'); - if($reponse->statusCode == 200 && $reponse->body->code == 'OK'){ - $log->status = 1; - $log->callId = $reponse->body->callId; - $log->save(); + if($status){ + $reponse = DyvmsService::getInstance()->call($dispatch->worker_tel, $ttsCode, md5(time())); + + if($reponse->statusCode == 200 && $reponse->body->code == 'OK'){ + $log->status = 1; + $log->callId = $reponse->body->callId; + $log->save(); + }else{ + $log->status = -1; + $log->content = $reponse->body->message; + $log->save(); + } }else{ - $log->status = -1; - $log->content = $reponse->body->message; - $log->save(); + throw new Exception('语音通知服务未开启'); } }catch (Exception $exception){ $log->status = -1;