mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-08 04:48:10 +08:00
fix: 减少 glob 和 realpath 等函数的使用,方便后续 phar 使用。
This commit is contained in:
parent
7497620aeb
commit
19028ae692
@ -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;
|
||||
}
|
||||
|
||||
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user