|
|
@@ -19,10 +19,10 @@ class SmsService
|
|
|
|
|
|
/**
|
|
|
* @param $phone
|
|
|
- * @return bool
|
|
|
+ * @return void
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public static function sendPhoneCode($phone): bool
|
|
|
+ public static function sendPhoneCode($phone): void
|
|
|
{
|
|
|
|
|
|
$username = config('services.sms.username');
|
|
|
@@ -40,7 +40,6 @@ class SmsService
|
|
|
if (!empty(static::$errors[$code])) {
|
|
|
throw new Exception(static::$errors[$code], HttpStatus::CUSTOM_ERROR);
|
|
|
}
|
|
|
- if ($code == 0) return true;
|
|
|
- throw new Exception("发送失败", HttpStatus::CUSTOM_ERROR);
|
|
|
+ if ($code != 0) throw new Exception("发送失败", HttpStatus::CUSTOM_ERROR);
|
|
|
}
|
|
|
}
|