文章接口微调

This commit is contained in:
焦钰锟 2025-04-09 13:55:07 +08:00
parent 80acb020ea
commit 463ec3b5e4
3 changed files with 14 additions and 3 deletions

View File

@ -48,6 +48,10 @@ class AuthController extends BaseController
$this->adminId = $this->request->adminId();//获取当前登陆管理员ID
$this->adminInfo = $this->request->adminInfo();//获取当前登陆管理员信息
$this->auth = $this->request->adminInfo['rule'] ?? [];//获取当前登陆管理员权限
}
/**

View File

@ -45,11 +45,13 @@ class ArticleController
$where = ['cid' => $cid];
}
[$page, $limit] = $this->services->getPageValue();
$list = $this->services->getList($where, $page, $limit)['list'];
$data = $this->services->getList($where, $page, $limit);
$list = $data['list'];
$count = $data['count'];
foreach ($list as &$item){
$item['add_time'] = date('Y-m-d H:i', $item['add_time']);
}
return app('json')->success($list);
return app('json')->success(['list'=>$list,"count"=>$count]);
}
/**

View File

@ -48,7 +48,12 @@ Route::miss(function () {
} else {
return view(app()->getRootPath() . 'public' . DS . 'index.html');
if (is_dir(app()->getRootPath() . 'public' . DS . 'web') && !request()->get('mdType')) {
return view(app()->getRootPath() . 'public' . DS . 'web' . DS . 'index.html');
} else {
return view(app()->getRootPath() . 'public' . DS . 'index.html');
}
}
}
});