user(); //是否临时会员 if (!empty($user->temp_member)) { return $next($request); } //是否认证 if (empty($user->is_real_approved)) { return $this->fail(5, '/authentication', '前去认证', '你还未真人认证,先去认证一下吧!'); } //是否完成资料 $result = UserService::isCompleteProfile($user->id); if (empty($result)) { $page = $user->type === 'single'?'/singleData':'/marriageData'; return $this->fail(5, $page, '完善资料', '你的个人资料未完善,需要完善一下哦!'); } return $next($request); } public function fail($code = 5, $path='', $operate='', $notice='') { $result = [ 'code'=> $code, 'path'=> $path, 'operate'=> $operate, 'notice'=> $notice, ]; return Response()->json($result); } }