diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php index 0ec8a43..7c41feb 100644 --- a/themes/beauty/controller/ListController.php +++ b/themes/beauty/controller/ListController.php @@ -100,7 +100,7 @@ Class ListController extends Controller { //获取目录面包屑 - $subcate = $scanResults[$cateId]; + $subcate = !empty($scanResults[$cateId]) ? $scanResults[$cateId] : array(); $breadcrumbs = $this->getBreadcrumbs($currentDir, $cachedParentData, $scanner); //图片、视频类型筛选支持 @@ -152,7 +152,7 @@ Class ListController extends Controller { //dataType支持:[image, video] $dataType = $this->get('dataType', 'html'); - if ($dataType == 'image') { + if ($dataType == 'image' && !empty($subcate['files'])) { $imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif'); $imgs = array(); $pageStartIndex = ($page-1) * $pageSize; @@ -172,7 +172,7 @@ Class ListController extends Controller { } } return $this->renderJson(compact('page', 'pageSize', 'imgs')); - }else if ($dataType == 'video') { + }else if ($dataType == 'video' && !empty($subcate['files'])) { $videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8'); $videos = array(); $pageStartIndex = ($page-1) * $pageSize;