Commit ba2cd973 by 朱继来

调整访问权限

parent 36871cc8
......@@ -12,7 +12,7 @@
public function checkAccess($request)
{
$user_id = $request->user->userId;
$role = $this->getUserRole($request);
$role = $this->getUserRole($request);
if ($role == 1) return true; // 超级管理员或系统管理员直接进入
......@@ -20,7 +20,18 @@
if (!$userPerms) return false;
if (in_array('apply_access', $userPerms)) return true; // 访问权限ID是否存在
$parse_url = parse_url($request->url()); // 页面url
$path = $parse_url['path']; // path路径
if (preg_match('/\/web\//', $path)) {
$permId = str_replace('/web/','',$path);
} else {
$permId = str_replace('/', '', $path);
}
$permId = $permId . '_check'; // 路径查看权限
if (in_array('apply_access', $userPerms) && in_array($permId, $userPerms)) return true; // 访问及路径权限存在,则返回true
return false;
}
......
......@@ -17,8 +17,10 @@
<h1></h1>
<h2 class="font-bold">禁止访问</h2>
<div class="error-desc">
暂时没有系统访问权限,请到权限系统申请该系统访问权限......<br/>
<a href="{{ Config('website.perm_url') }}/business/{{$bid}}/request" style="font-size: 18px;"><i class="fa fa-mail-reply"></i>申请</a>
<p>暂时没有访问权限,请到权限系统申请该权限......</p>
<a href="{{ Config('website.perm_url') }}/business/{{$bid}}/request" style="font-size: 18px;" target="_blank">
<i class="fa fa-mail-reply"></i>申请
</a>
</div>
</div>
</body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment