Skip to content

Commit be22ae6

Browse files
Zhao-githubgitee-org
authored andcommitted
!26 权限校验问题
Merge pull request !26 from ThinkHalo/ufec
2 parents 89199a2 + eaf5058 commit be22ae6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/middleware/AdminPermission.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class AdminPermission {
2323
*/
2424
public function handle($request, \Closure $next): Response {
2525
$userInfo = $request->API_ADMIN_USER_INFO;
26-
27-
if (!$this->checkAuth($userInfo['id'], $request->pathinfo())) {
26+
// rule里包含了rule(路由规则), ruoter(完整路由)
27+
if (!$this->checkAuth($userInfo['id'], $request->rule()->getRule())) {
2828
return json([
2929
'code' => ReturnCode::INVALID,
3030
'msg' => '非常抱歉,您没有权限这么做!',

0 commit comments

Comments
 (0)