From 62de2c4a9233e10b22869d6b10f310e036f7110b Mon Sep 17 00:00:00 2001 From: zhang Date: Fri, 25 Sep 2020 16:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dapi=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Form.php | 1 + src/helpers.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Form.php b/src/Form.php index c668da8..0bc1133 100644 --- a/src/Form.php +++ b/src/Form.php @@ -294,6 +294,7 @@ public function getResourceId() public function resource($slice = -2): string { + $segments = explode('/', trim(admin_api_url(request()->path()), '/')); if ($slice !== 0) { diff --git a/src/helpers.php b/src/helpers.php index 49b2766..2adff1d 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -103,7 +103,7 @@ function admin_api_url($path = '', $parameters = [], $secure = null) return $path; } $secure = $secure ?: (config('admin.https') || config('admin.secure')); - return url(admin_api_base_path($path), $parameters, $secure); + return url($path, $parameters, $secure); } }