更新文章列表详情

This commit is contained in:
yaooo 2023-10-30 17:35:21 +08:00
parent 78d21ea49f
commit 7b8ba6b53c
1 changed files with 7 additions and 7 deletions

View File

@ -147,8 +147,8 @@ abstract class ApiController
protected function checkAuth()
{
$uid = JWT_UID;
$login_admin = Db::name('Admin')->where(['id' => $uid])->find();
if(!$login_admin['status']){
$loginAdmin = Db::name('Admin')->where(['id' => $uid])->find();
if(!$loginAdmin['status']){
$this->apiError('用户已禁止登录');
}
$baseUrl = explode('/', request()->baseUrl());
@ -157,12 +157,12 @@ abstract class ApiController
$controllerArray = explode('_', $controller);
$prefixMod = strtolower($controllerArray[0] ?? '-');
$conMod = strtolower($controllerArray[1] ?? '-');
$GOUGU = new Systematic();
$GOUGU->auth($uid);
$auth_list_all = Cache::get('RulesSrc0');
$auth_list = Cache::get('RulesSrc' . $uid);
$gougu = new Systematic();
$gougu->auth($uid);
$authListAll = Cache::get('RulesSrc0');
$authList = Cache::get('RulesSrc' . $uid);
$pathUrl = $prefixMod . '/' . $conMod . '/' . $action;
if (!in_array($pathUrl, $auth_list)) {
if (!in_array($pathUrl, $authList)) {
$this->apiError('用户无权限');
}
}