Ken пре 3 дана
родитељ
комит
e158df58fb
1 измењених фајлова са 3 додато и 4 уклоњено
  1. 3 4
      app/Services/SmsService.php

+ 3 - 4
app/Services/SmsService.php

@@ -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);
     }
 }