Browse Source

add alert message

master
filesite 3 months ago
parent
commit
90cacbbcd2
  1. 3
      themes/beauty/controller/ListController.php
  2. 7
      themes/beauty/controller/SiteController.php
  3. 7
      themes/beauty/views/site/index.php

3
themes/beauty/controller/ListController.php

@ -27,7 +27,8 @@ Class ListController extends Controller { @@ -27,7 +27,8 @@ Class ListController extends Controller {
$cacheSeconds = 86400;
$cachedParentData = Common::getCacheFromFile($cacheParentDataId, $cacheSeconds);
if (empty($cachedParentData)) {
return $this->redirect('/');
$err = '缓存数据已失效,如果重新点击目录依然打不开,请联系管理员。';
return $this->redirect('/?err=' . urlencode($err));
}
if (strpos($cacheParentDataId, $cateId) === false && empty($cachedParentData[$cateId])) {

7
themes/beauty/controller/SiteController.php

@ -123,6 +123,10 @@ Class SiteController extends Controller { @@ -123,6 +123,10 @@ Class SiteController extends Controller {
}
//提示信息支持
$alertWarning = $this->get('err', '');
//翻页支持
$page = $this->get('page', 1);
$pageSize = $this->get('limit', 24);
@ -214,7 +218,8 @@ Class SiteController extends Controller { @@ -214,7 +218,8 @@ Class SiteController extends Controller {
$viewName = 'index';
$params = compact(
'page', 'pageSize', 'cacheDataId', 'showType',
'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', 'mp3File', 'copyright'
'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme', 'mp3File', 'copyright',
'alertWarning'
);
return $this->render($viewName, $params, $pageTitle);
}

7
themes/beauty/views/site/index.php

@ -99,6 +99,13 @@ if ($total > 0) { @@ -99,6 +99,13 @@ if ($total > 0) {
eof;
}
if (!empty($viewData['alertWarning'])) {
echo <<<eof
<div class="alert alert-warning">{$viewData['alertWarning']}</div>
eof;
}
echo <<<eof
<div class="breadcrumbs text_dark">
{$totalNum}

Loading…
Cancel
Save