From 79f414ad935e4e02fe8b8ef0b9cc321dda8e37a1 Mon Sep 17 00:00:00 2001 From: Ying Date: Mon, 26 Jun 2023 15:23:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/notice/SmsService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/common/service/notice/SmsService.php b/app/common/service/notice/SmsService.php index 9baeb9c..9d8f525 100644 --- a/app/common/service/notice/SmsService.php +++ b/app/common/service/notice/SmsService.php @@ -71,7 +71,7 @@ class SmsService throw new OperateException(__('短信插件未安装')); } - list($smsType, $config) = self::getSmsConfig(); + list('type' => $smsType, 'config' => $config) = self::getSmsConfig(); $smsConf = include(root_path() . "extend/conf/sms/sms.php"); if (!isset($smsConf[$smsType][$event]['template'])) { throw new OperateException(__('短信模板错误')); @@ -83,8 +83,8 @@ class SmsService 'template' => $smsConf[$smsType][$event]['template'], ],true); - if (isset($response['error']) && $response['error']) { - throw new \Exception($response['error']); + if ($response['error'] == 1) { + throw new \Exception($response['msg']); } return true; @@ -153,7 +153,9 @@ class SmsService protected static function getSmsConfig(): array { $smsType = saenv('smstype'); + var_dump($smsType); $config = saenv($smsType) ?? []; + var_dump($config); return ['type' => $smsType, 'config' => $config]; } } \ No newline at end of file