更新前端相关
This commit is contained in:
parent
a32b1656b0
commit
776aacfa2e
@ -8,7 +8,7 @@ use app\admin\BaseController;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\response\Json;
|
||||
use app\model\SystemSiteSettings;
|
||||
use app\model\System\SystemSiteSettings;
|
||||
|
||||
class SiteSettingsController extends BaseController
|
||||
{
|
||||
@ -19,7 +19,7 @@ class SiteSettingsController extends BaseController
|
||||
public function getNormalInfos()
|
||||
{
|
||||
$siteSettings = SystemSiteSettings::where('delete_time', null)
|
||||
->field('id, label, value, sort')
|
||||
->field('id, label, value, sort')
|
||||
->order('id', 'asc')
|
||||
->select();
|
||||
return json([
|
||||
@ -88,7 +88,7 @@ class SiteSettingsController extends BaseController
|
||||
public function getLegalInfos()
|
||||
{
|
||||
$siteSettings = SystemSiteSettings::where('delete_time', null)
|
||||
->field('id, label, value, sort')
|
||||
->field('id, label, value, sort')
|
||||
->order('id', 'asc')
|
||||
->select();
|
||||
return json([
|
||||
|
||||
@ -10,6 +10,7 @@ use app\model\FrontMenu;
|
||||
use app\model\OnePage;
|
||||
use think\db\exception\DbException;
|
||||
use think\facade\Env;
|
||||
use app\model\System\SystemSiteSettings;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
@ -30,7 +31,7 @@ class Index extends BaseController
|
||||
$files = glob($logPath . '*.log');
|
||||
if ($files) {
|
||||
// 按修改时间排序,最新的在前
|
||||
usort($files, function($a, $b) {
|
||||
usort($files, function ($a, $b) {
|
||||
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
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,9 @@ use think\facade\Route;
|
||||
Route::get('/', '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('companynews/detail/:id', 'app\index\controller\Article\NewsCenterController@getCompanyNewsDetail');
|
||||
|
||||
@ -9,13 +9,13 @@
|
||||
// | Author: Liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model;
|
||||
namespace app\model\System;
|
||||
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 文章分类模型
|
||||
* 站点设置模型
|
||||
*/
|
||||
class SystemSiteSettings extends Model
|
||||
{
|
||||
@ -27,10 +27,10 @@ class SystemSiteSettings extends Model
|
||||
|
||||
// 字段类型转换
|
||||
protected $type = [
|
||||
'id' => 'integer',
|
||||
'label' => 'string',
|
||||
'value' => 'string',
|
||||
'sort' => 'integer',
|
||||
'remark' => 'string',
|
||||
'id' => 'integer',
|
||||
'label' => 'string',
|
||||
'value' => 'string',
|
||||
'sort' => 'integer',
|
||||
'remark' => 'string',
|
||||
];
|
||||
}
|
||||
BIN
public/storage/uploads/2026/02/05/6984b341c401d.png
Normal file
BIN
public/storage/uploads/2026/02/05/6984b341c401d.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
BIN
public/storage/uploads/2026/02/05/6984bc0015123.png
Normal file
BIN
public/storage/uploads/2026/02/05/6984bc0015123.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Loading…
Reference in New Issue
Block a user