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