Example #1
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $data['uid'] = $request->input('uid');
     $data['token'] = $request->input('token');
     if (\App\Services\User\UserService::checkAuthToken($data)) {
         return $next($request);
     }
     throw new \App\Exceptions\ServiceException('授权失败', 600);
 }
 public function getCode()
 {
     $phone = \Input::get('phone');
     $key = \App\Services\User\UserService::getRedisKeys('smsKey', [date('Ymd'), $phone]);
     $data = \LRedis::GET($key);
     $data && ($data = json_decode($data, 1));
     $last = end($data);
     return $this->__json(200, 'ok', $last);
 }