up. 添加lock锁屏功能
This commit is contained in:
parent
6fceb65aa7
commit
75ae9586b5
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\http\middleware;
|
||||
|
||||
use app\entity\SysUserClient;
|
||||
use app\model\SysUser;
|
||||
use app\Request;
|
||||
use app\service\admin\LoginService;
|
||||
@ -38,6 +39,21 @@ class AuthMiddleware extends Middleware
|
||||
$auth = $loginSrv->getVisitor($request);
|
||||
return json(['code' => 401, 'message' => '禁止访问']);
|
||||
}
|
||||
$client = Request::getClient();
|
||||
$clientModel = SysUserClient::where([
|
||||
'client_id' => $client->id,
|
||||
'client_name'=> $client->name,
|
||||
'user_id' => $auth->userId
|
||||
])->find();
|
||||
if(empty($clientModel)) {
|
||||
return json(['code' => 401, 'message' => '设备下线']);
|
||||
}
|
||||
if(1 != $clientModel->status) {
|
||||
return json(['code' => 401, 'message' => '设备禁用']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 注入获取用户信息的function
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user