Exemplo n.º 1
0
 public function version()
 {
     $version = Version::select('id', 'version_code', 'url', 'message', 'description')->where('platform', 0)->where('status', 1)->orderBy('version_code', 'desc')->first();
     return ApiResponse::responseSuccess($version);
 }
Exemplo n.º 2
0
 /**
  * 获取语音验证码API
  * @return mixed
  */
 public function verify()
 {
     if (!$this->validation->passes($this->validation->phoneRules)) {
         return ApiResponse::validation($this->validation);
     }
     $phone = Input::get('phone');
     if (config('quickcms.sms_api_switch')) {
         $captcha = rand(1000, 9999);
         $sms = new LuoSiMaoSms(config('quickcms.sms_api_key_verify'));
         // 拨打语音电话至用户
         $sms->sendVerify($phone, $captcha);
     } else {
         $captcha = '1234';
     }
     $expiresAt = Carbon::now()->addMinutes(30);
     Cache::put($phone, $captcha, $expiresAt);
     return ApiResponse::responseSuccess();
 }