更新前端相关

This commit is contained in:
扫地僧 2026-02-06 00:06:11 +08:00
parent a32b1656b0
commit 776aacfa2e
6 changed files with 55 additions and 25 deletions

View File

@ -8,7 +8,7 @@ use app\admin\BaseController;
use think\exception\ValidateException; use think\exception\ValidateException;
use think\facade\Db; use think\facade\Db;
use think\response\Json; use think\response\Json;
use app\model\SystemSiteSettings; use app\model\System\SystemSiteSettings;
class SiteSettingsController extends BaseController class SiteSettingsController extends BaseController
{ {
@ -19,7 +19,7 @@ class SiteSettingsController extends BaseController
public function getNormalInfos() public function getNormalInfos()
{ {
$siteSettings = SystemSiteSettings::where('delete_time', null) $siteSettings = SystemSiteSettings::where('delete_time', null)
->field('id, label, value, sort') ->field('id, label, value, sort')
->order('id', 'asc') ->order('id', 'asc')
->select(); ->select();
return json([ return json([
@ -88,7 +88,7 @@ class SiteSettingsController extends BaseController
public function getLegalInfos() public function getLegalInfos()
{ {
$siteSettings = SystemSiteSettings::where('delete_time', null) $siteSettings = SystemSiteSettings::where('delete_time', null)
->field('id, label, value, sort') ->field('id, label, value, sort')
->order('id', 'asc') ->order('id', 'asc')
->select(); ->select();
return json([ return json([

View File

@ -10,6 +10,7 @@ use app\model\FrontMenu;
use app\model\OnePage; use app\model\OnePage;
use think\db\exception\DbException; use think\db\exception\DbException;
use think\facade\Env; use think\facade\Env;
use app\model\System\SystemSiteSettings;
class Index extends BaseController class Index extends BaseController
{ {
@ -30,7 +31,7 @@ class Index extends BaseController
$files = glob($logPath . '*.log'); $files = glob($logPath . '*.log');
if ($files) { if ($files) {
// 按修改时间排序,最新的在前 // 按修改时间排序,最新的在前
usort($files, function($a, $b) { usort($files, function ($a, $b) {
return filemtime($b) - filemtime($a); return filemtime($b) - filemtime($a);
}); });
@ -174,4 +175,30 @@ class Index extends BaseController
]); ]);
} }
} }
/**
* 前端底部数据
* @return \think\response\Json
*/
public function getFooterData()
{
try {
$footerData = SystemSiteSettings::where('delete_time', null)
->field('label, value')
->select()
->toArray();
return json([
'code' => 200,
'msg' => 'success',
'data' => $footerData
]);
} catch (DbException $e) {
return json([
'code' => 500,
'msg' => 'fail' . $e->getMessage(),
'data' => null
]);
}
}
} }

View File

@ -5,6 +5,9 @@ use think\facade\Route;
Route::get('/', 'app\index\controller\Index@index'); Route::get('/', 'app\index\controller\Index@index');
Route::get('index/index', 'app\index\controller\Index@index'); Route::get('index/index', 'app\index\controller\Index@index');
// --- 前端底部数据路由 ---
Route::get('footerdata', 'app\index\controller\Index@getFooterData');
// --- 文章详情路由 --- // --- 文章详情路由 ---
Route::get('kingdeenews/detail/:id', 'app\index\controller\Article\NewsCenterController@getKingdeeNewsDetail'); Route::get('kingdeenews/detail/:id', 'app\index\controller\Article\NewsCenterController@getKingdeeNewsDetail');
Route::get('companynews/detail/:id', 'app\index\controller\Article\NewsCenterController@getCompanyNewsDetail'); Route::get('companynews/detail/:id', 'app\index\controller\Article\NewsCenterController@getCompanyNewsDetail');

View File

@ -9,13 +9,13 @@
// | Author: Liu21st <liu21st@gmail.com> // | Author: Liu21st <liu21st@gmail.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\model; namespace app\model\System;
use think\Model; use think\Model;
use think\model\concern\SoftDelete; use think\model\concern\SoftDelete;
/** /**
* 文章分类模型 * 站点设置模型
*/ */
class SystemSiteSettings extends Model class SystemSiteSettings extends Model
{ {
@ -27,10 +27,10 @@ class SystemSiteSettings extends Model
// 字段类型转换 // 字段类型转换
protected $type = [ protected $type = [
'id' => 'integer', 'id' => 'integer',
'label' => 'string', 'label' => 'string',
'value' => 'string', 'value' => 'string',
'sort' => 'integer', 'sort' => 'integer',
'remark' => 'string', 'remark' => 'string',
]; ];
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB