fix: 修复一处短信调用
This commit is contained in:
@@ -71,7 +71,7 @@ class SmsService
|
|||||||
throw new OperateException(__('短信插件未安装'));
|
throw new OperateException(__('短信插件未安装'));
|
||||||
}
|
}
|
||||||
|
|
||||||
list($smsType, $config) = self::getSmsConfig();
|
list('type' => $smsType, 'config' => $config) = self::getSmsConfig();
|
||||||
$smsConf = include(root_path() . "extend/conf/sms/sms.php");
|
$smsConf = include(root_path() . "extend/conf/sms/sms.php");
|
||||||
if (!isset($smsConf[$smsType][$event]['template'])) {
|
if (!isset($smsConf[$smsType][$event]['template'])) {
|
||||||
throw new OperateException(__('短信模板错误'));
|
throw new OperateException(__('短信模板错误'));
|
||||||
@@ -83,8 +83,8 @@ class SmsService
|
|||||||
'template' => $smsConf[$smsType][$event]['template'],
|
'template' => $smsConf[$smsType][$event]['template'],
|
||||||
],true);
|
],true);
|
||||||
|
|
||||||
if (isset($response['error']) && $response['error']) {
|
if ($response['error'] == 1) {
|
||||||
throw new \Exception($response['error']);
|
throw new \Exception($response['msg']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -153,7 +153,9 @@ class SmsService
|
|||||||
protected static function getSmsConfig(): array
|
protected static function getSmsConfig(): array
|
||||||
{
|
{
|
||||||
$smsType = saenv('smstype');
|
$smsType = saenv('smstype');
|
||||||
|
var_dump($smsType);
|
||||||
$config = saenv($smsType) ?? [];
|
$config = saenv($smsType) ?? [];
|
||||||
|
var_dump($config);
|
||||||
return ['type' => $smsType, 'config' => $config];
|
return ['type' => $smsType, 'config' => $config];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user