save
This commit is contained in:
parent
c9df58cacf
commit
b2fa0399d5
@ -98,7 +98,6 @@ class Auth
|
|||||||
|
|
||||||
// 如果action为index,规则里有任意一个以$controller开头的权限即可
|
// 如果action为index,规则里有任意一个以$controller开头的权限即可
|
||||||
if (strtolower($action) === 'index') {
|
if (strtolower($action) === 'index') {
|
||||||
$controller = str_replace('\\', '\\\\', $controller);
|
|
||||||
$rule = Rule::where(function ($query) use ($controller, $action) {
|
$rule = Rule::where(function ($query) use ($controller, $action) {
|
||||||
$query->where('key', 'like', "$controller@%")->orWhere('key', $controller);
|
$query->where('key', 'like', "$controller@%")->orWhere('key', $controller);
|
||||||
})->whereIn('id', $rule_ids)->first();
|
})->whereIn('id', $rule_ids)->first();
|
||||||
|
@ -37,7 +37,7 @@ class AccessControl implements MiddlewareInterface
|
|||||||
EOF
|
EOF
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$response = view('common/error/403');
|
$response = view('common/error/403')->withStatus(403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user