smsService = $smsService; } public function send() { $mobile = $this->request->input('mobile', null); $options = $this->request->input('options', []); if (!$mobile) { throw new BusinessException('缺少参数[mobile]'); } if (!isset($options['type'])) { throw new BusinessException('缺少参数options[type]'); } Queue::push(SmsJob::class, [ 'mobile' => $mobile, 'options' => $options, ]); return $this->success(); } public function check() { $mobile = $this->request->input('mobile', ''); $code = $this->request->input('code', ''); if (!$mobile) { throw new BusinessException('缺少参数[mobile]'); } if (!$code) { throw new BusinessException('缺少参数[code]'); } if (!$this->smsService->check($mobile, $code)) { throw new BusinessException('验证失败'); } return $this->success('验证成功'); } }