request = $request; $this->smsService = $smsService; } /** * 短信验证码接口 * * @return \Illuminate\Http\Response */ public function vcode() { $mobile = $this->request->get('mobile'); if ($this->request->isMethod('post')) { $code = $this->request->get('code'); $this->smsService->verifyCode($mobile, $code); return res(true, '验证码正确'); } $freqsecs = $this->smsService->sendVcode($mobile, self::PRODUCT); return res(['freg' => $freqsecs], '发送成功'); } }