|
|
@@ -39,12 +39,16 @@ class Annex extends AdminController
|
|
|
// 'create_at' => filectime(app()->getRootPath() . '/public/uploads/' . rawurlencode($dir))
|
|
|
];
|
|
|
}
|
|
|
+
|
|
|
// halt($dirs);
|
|
|
// 取出本地存储文件
|
|
|
foreach ($filesystem->getFiles() as $file) {
|
|
|
+ if($file == '..' || $file == '.DS_Store'){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
$type = get_file_ext($file);
|
|
|
-
|
|
|
+// $file = isset($file['name'])? ltrim($file['name'],'/') : '';
|
|
|
$info = [
|
|
|
'name' => $file,
|
|
|
'type' => $type,
|
|
|
@@ -52,11 +56,13 @@ class Annex extends AdminController
|
|
|
'url' => get_annex_url($path . '/' . $file),
|
|
|
'create_at' => filectime(app()->getRootPath() . "/public/uploads/" . $path . '/' . $file)
|
|
|
];
|
|
|
+
|
|
|
if (in_array($type, ['png', 'jpg', 'jpeg', 'gif'])) {
|
|
|
$info['thumbs'] = get_annex_url($path . '/' . $file);
|
|
|
}
|
|
|
$annex[] = $info;
|
|
|
}
|
|
|
+
|
|
|
$total = count($annex);
|
|
|
$array = [];
|
|
|
// 分页处理
|