From 271f7481dacc6178a7b7e374143e80d133702dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 17 Oct 2024 11:25:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/api/Plugs.php | 2 +- app/admin/controller/api/Upload.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/admin/controller/api/Plugs.php b/app/admin/controller/api/Plugs.php index 6b6199acb..aabb79164 100644 --- a/app/admin/controller/api/Plugs.php +++ b/app/admin/controller/api/Plugs.php @@ -56,7 +56,7 @@ class Plugs extends Controller } } $this->field = $this->app->request->get('field', 'icon'); - $this->fetch(realpath(__DIR__ . '/../../view/api/icon.html')); + $this->fetch(dirname(__DIR__, 2) . '/view/api/icon.html'); } /** diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index c6e38dc5f..097646311 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -52,10 +52,9 @@ class Upload extends Controller $allows = str2arr(sysconf('storage.allow_exts|raw')); if (empty($uuid) && $unid > 0) $allows = array_intersect($exts, $allows); foreach ($allows as $ext) $data['exts'][$ext] = Storage::mime($ext); - $template = realpath(__DIR__ . '/../../view/api/upload.js'); $data['exts'] = json_encode($data['exts'], JSON_UNESCAPED_UNICODE); $data['nameType'] = sysconf('storage.name_type|raw') ?: 'xmd5'; - return view($template, $data)->contentType('application/x-javascript'); + return view(dirname(__DIR__, 2) . '/view/api/upload.js', $data)->contentType('application/x-javascript'); } /**