feat: 在 JwtAuthMiddleware 中添加用户状态检查,处理封禁用户的请求
This commit is contained in:
parent
248abb51c2
commit
dd329c6ee0
|
@ -74,6 +74,10 @@ class JwtAuthMiddleware implements MiddlewareInterface
|
||||||
if (false !== strstr($controller->name, 'admin') || false !== strstr($controller->name, 'generalization')) {
|
if (false !== strstr($controller->name, 'admin') || false !== strstr($controller->name, 'generalization')) {
|
||||||
return response('', 401, ['error' => '无权限']);
|
return response('', 401, ['error' => '无权限']);
|
||||||
}
|
}
|
||||||
|
$user=User::find($decoded['id']);
|
||||||
|
if($user->status==0){
|
||||||
|
return response('',401,['error' => '用户封禁']);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'generalization':
|
case 'generalization':
|
||||||
|
|
Loading…
Reference in New Issue