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'); } /**