Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ba2cd973
authored
Nov 14, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整访问权限
parent
36871cc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
app/Http/Controllers/PermController.php
resources/views/no_access.blade.php
app/Http/Controllers/PermController.php
View file @
ba2cd973
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
public
function
checkAccess
(
$request
)
public
function
checkAccess
(
$request
)
{
{
$user_id
=
$request
->
user
->
userId
;
$user_id
=
$request
->
user
->
userId
;
$role
=
$this
->
getUserRole
(
$request
);
$role
=
$this
->
getUserRole
(
$request
);
if
(
$role
==
1
)
return
true
;
// 超级管理员或系统管理员直接进入
if
(
$role
==
1
)
return
true
;
// 超级管理员或系统管理员直接进入
...
@@ -20,7 +20,18 @@
...
@@ -20,7 +20,18 @@
if
(
!
$userPerms
)
return
false
;
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
;
return
false
;
}
}
...
...
resources/views/no_access.blade.php
View file @
ba2cd973
...
@@ -17,8 +17,10 @@
...
@@ -17,8 +17,10 @@
<h1></h1>
<h1></h1>
<h2
class=
"font-bold"
>
禁止访问
</h2>
<h2
class=
"font-bold"
>
禁止访问
</h2>
<div
class=
"error-desc"
>
<div
class=
"error-desc"
>
暂时没有系统访问权限,请到权限系统申请该系统访问权限......
<br/>
<p>
暂时没有访问权限,请到权限系统申请该权限......
</p>
<a
href=
"{{ Config('website.perm_url') }}/business/{{$bid}}/request"
style=
"font-size: 18px;"
><i
class=
"fa fa-mail-reply"
></i>
申请
</a>
<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>
</div>
</div>
</body>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment