更新文章列表详情
This commit is contained in:
parent
78d21ea49f
commit
7b8ba6b53c
|
@ -147,8 +147,8 @@ abstract class ApiController
|
||||||
protected function checkAuth()
|
protected function checkAuth()
|
||||||
{
|
{
|
||||||
$uid = JWT_UID;
|
$uid = JWT_UID;
|
||||||
$login_admin = Db::name('Admin')->where(['id' => $uid])->find();
|
$loginAdmin = Db::name('Admin')->where(['id' => $uid])->find();
|
||||||
if(!$login_admin['status']){
|
if(!$loginAdmin['status']){
|
||||||
$this->apiError('用户已禁止登录');
|
$this->apiError('用户已禁止登录');
|
||||||
}
|
}
|
||||||
$baseUrl = explode('/', request()->baseUrl());
|
$baseUrl = explode('/', request()->baseUrl());
|
||||||
|
@ -157,12 +157,12 @@ abstract class ApiController
|
||||||
$controllerArray = explode('_', $controller);
|
$controllerArray = explode('_', $controller);
|
||||||
$prefixMod = strtolower($controllerArray[0] ?? '-');
|
$prefixMod = strtolower($controllerArray[0] ?? '-');
|
||||||
$conMod = strtolower($controllerArray[1] ?? '-');
|
$conMod = strtolower($controllerArray[1] ?? '-');
|
||||||
$GOUGU = new Systematic();
|
$gougu = new Systematic();
|
||||||
$GOUGU->auth($uid);
|
$gougu->auth($uid);
|
||||||
$auth_list_all = Cache::get('RulesSrc0');
|
$authListAll = Cache::get('RulesSrc0');
|
||||||
$auth_list = Cache::get('RulesSrc' . $uid);
|
$authList = Cache::get('RulesSrc' . $uid);
|
||||||
$pathUrl = $prefixMod . '/' . $conMod . '/' . $action;
|
$pathUrl = $prefixMod . '/' . $conMod . '/' . $action;
|
||||||
if (!in_array($pathUrl, $auth_list)) {
|
if (!in_array($pathUrl, $authList)) {
|
||||||
$this->apiError('用户无权限');
|
$this->apiError('用户无权限');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue