|
|
@@ -113,9 +113,9 @@ class ChuanglanSmsApi {
|
|
|
|
|
|
private static function getAccountConfig($accountKey)
|
|
|
{
|
|
|
- $accounts = self::env('SMS_ACCOUNTS');
|
|
|
- if (!empty($accounts)) {
|
|
|
- $accounts = json_decode($accounts, true);
|
|
|
+ $accountsConfig = self::env('SMS_ACCOUNTS');
|
|
|
+ if (!empty($accountsConfig)) {
|
|
|
+ $accounts = json_decode($accountsConfig, true);
|
|
|
if (!is_array($accounts)) {
|
|
|
util::fail('短信账号配置格式错误');
|
|
|
}
|
|
|
@@ -127,6 +127,8 @@ class ChuanglanSmsApi {
|
|
|
if ($accountKey !== 'default') {
|
|
|
util::fail('短信账号不存在');
|
|
|
}
|
|
|
+ } elseif ($accountKey !== 'default') {
|
|
|
+ util::fail('短信多账号配置不存在');
|
|
|
}
|
|
|
|
|
|
$account = self::env('CHUANGLAN_SMS_ACCOUNT', self::API_ACCOUNT);
|
|
|
@@ -154,7 +156,7 @@ class ChuanglanSmsApi {
|
|
|
return $value;
|
|
|
}
|
|
|
|
|
|
- return '';
|
|
|
+ return $default;
|
|
|
}
|
|
|
|
|
|
/**
|