Skip to content

Commit eaf5058

Browse files
author
ufec
committed
权限校验问题
1 parent 89199a2 commit eaf5058

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)