smsService = $smsService; $this->geetestService = $geetestService; $this->authService = $authService; } public function sendSms(SmsValidatorRequest $smsValidatorRequest) { $method=$smsValidatorRequest->type.'Sms'; $result=$this->$method($smsValidatorRequest->mobile); return $result; } protected function loginSms($mobile) { if (!$this->authService->checkUser($mobile, "", 2)) { return $this->sendErrorResponse("该手机号码没有绑定账号,请先注册"); } $this->smsService->sendAuthSms($mobile, Smser::TEMPLATE_AUTH_LOGIN); return $this->sendSuccessResponse(); } protected function registerSms($mobile) { // if (config('aix.system.site_safety.site_vo_code.captcha_open') == 1) { // if (!$this->geetestService->checkGeetest()) { // return $this->sendErrorResponse("验证码不通过,请重新验证"); // } // } $this->smsService->sendAuthSms($mobile, Smser::TEMPLATE_AUTH_REGISTER); return $this->sendSuccessResponse(); } protected function checkSms($mobile) { // if (config('aix.system.site_safety.site_vo_code.captcha_open') == 1) { // if (!$this->geetestService->checkGeetest()) { // return $this->sendErrorResponse("验证码不通过,请重新验证"); // } // } $this->smsService->sendAuthSms($mobile, Smser::TEMPLATE_AUTH_CHECK); return $this->sendSuccessResponse(); } }