diff --git a/plugin/think-library/src/service/ModuleService.php b/plugin/think-library/src/service/ModuleService.php index d837baf23..2de2bd257 100644 --- a/plugin/think-library/src/service/ModuleService.php +++ b/plugin/think-library/src/service/ModuleService.php @@ -78,7 +78,7 @@ class ModuleService extends Service { $path = Library::$sapp->getBasePath(); foreach (scandir($path) as $item) if ($item[0] !== '.') { - if (is_dir(realpath($path . $item))) $data[] = $item; + if (is_dir($path . $item)) $data[] = $item; } return $data; } diff --git a/plugin/think-plugs-admin/src/controller/api/Plugs.php b/plugin/think-plugs-admin/src/controller/api/Plugs.php index 6b6199acb..aabb79164 100644 --- a/plugin/think-plugs-admin/src/controller/api/Plugs.php +++ b/plugin/think-plugs-admin/src/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/plugin/think-plugs-admin/src/controller/api/Upload.php b/plugin/think-plugs-admin/src/controller/api/Upload.php index c6e38dc5f..097646311 100644 --- a/plugin/think-plugs-admin/src/controller/api/Upload.php +++ b/plugin/think-plugs-admin/src/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'); } /**