From 44c2d0ac74e336a610576d2a81195e6ca2446e25 Mon Sep 17 00:00:00 2001 From: Chaim Date: Thu, 9 Jul 2020 23:54:58 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/RouteService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/service/RouteService.php b/src/service/RouteService.php index 074b9ca..9b69686 100644 --- a/src/service/RouteService.php +++ b/src/service/RouteService.php @@ -31,8 +31,9 @@ class RouteService extends Service * @param int $status * @param bool $parameter */ - public function redirect(string $url, int $status = 302, bool $parameter = false) + public function redirect(string $url = '', int $status = 302, bool $parameter = false) { + if (empty($url)) $url = request()->scheme() . "://" . request()->host(); if ($status === 302) header("Location: {$url}" . $parameter === true ? request()->query() : ''); elseif ($status === 301) { header('HTTP/1.1 301 Moved Permanently');