/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle($request, Closure $next) { if ($this->checkAccount() == false) { if ($request->ajax()) { return response('Unauthorized.', 401); } else { return redirect(user_url('/')); } } return $next($request); }
/** * 创建二维码并保存. * * @param Request $request * * @return \Illuminate\Http\JsonResponse */ public function postCreate(Request $request) { $easywechat = app('easywechat'); $qrcodeService = $easywechat->qrcode; if ($request->type = self::TYPE_FOREVER) { try { $result = $qrcodeService->forever($request->keyword); } catch (\Exception $e) { return error('创建失败'); } } elseif ($request->type = self::TYPE_TEMPORARY) { try { $result = $qrcodeService->temporary($request->keyword, $request->expire); } catch (\Exception $e) { return error('创建失败'); } } $qrcodeData = array_merge($request->all(), ['ticket' => $result->ticket]); $this->qrcodeRepository->create($qrcodeData); return error('保存成功', user_url('qrcode/' . $request->input('type'))); }
The project can be viewed at <?php echo user_url($this->user, 'project', 'view', array('id' => $this->project->id), true); ?> ----- Summary: <?php $this->o($this->model->title); ?> Severity: <?php $this->o($this->model->severity); ?> Type: <?php $this->o($this->model->issuetype); ?> Description: <?php $this->o($this->model->description, false); ?> ----- This is an automatically generated email from <?php echo user_url($this->user, 'index', 'index', null, true);
<?php require_once "trackstat.us.php"; require_once "user_functions.php"; require_once "url_functions.php"; # Break it up into parts $parts = explode("/", $_SERVER["REQUEST_URI"]); array_shift($parts); # Check for username if (preg_match("/\\w+/", $parts[0])) { $user = user_find_by_username($parts[0]); if ($user && count($parts) == 1) { redirect_to(user_url($user)); } } $t->display("404.tpl");
/** * @param $accountId * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ public function getManage($accountId) { //记录当前操作的公众号ID到会话 chose_account($accountId); return redirect(user_url('menu')); }
<?php echo $this->model->note; ?> <?php echo $this->model->userid; ?> <?php if ($this->toUrl != null) { echo user_url($this->user, ifset($this->toUrl, 'controller'), ifset($this->toUrl, 'action'), ifset($this->toUrl, 'params', ''), true); }