up. 优化代码内容
This commit is contained in:
parent
1702dd02a4
commit
a073e73f6d
@ -54,8 +54,11 @@ class AuthController extends BaseController
|
||||
'user_id' => $this->auth->userId,
|
||||
])->find();
|
||||
if($clientModel && $clientModel['is_lock']) {
|
||||
if (empty($clientModel['lock_password'])) {
|
||||
if(!password_verify($password, $this->auth->getUser()->get('password'))) {
|
||||
if(
|
||||
!password_verify($password, $this->auth->getUser()->get('password'))
|
||||
&&
|
||||
!password_verify($password, $clientModel['lock_password'])
|
||||
) {
|
||||
SysUserClientLog::create([
|
||||
'event' => 'UNLOCK_ERROR',
|
||||
'message'=> "1. 尝试解锁,密码错误",
|
||||
@ -65,18 +68,6 @@ class AuthController extends BaseController
|
||||
]);
|
||||
return $this->writeError('密码错误');
|
||||
}
|
||||
}else{
|
||||
if($clientModel['lock_password'] !== $password){
|
||||
SysUserClientLog::create([
|
||||
'event' => 'UNLOCK_ERROR',
|
||||
'message'=> "2. 尝试解锁,密码错误",
|
||||
'data' => json_encode(['inputPass'=> $password]),
|
||||
'create_time' => date('Y-m-d H:i:s'),
|
||||
'client_data_id'=> $clientModel['id']
|
||||
]);
|
||||
return $this->writeError('密码错误');
|
||||
}
|
||||
}
|
||||
$clientModel->save(['is_lock'=>0,'lock_password'=>'','lock_time'=>null]);
|
||||
SysUserClientLog::create([
|
||||
'event' => 'UNLOCK_SUCCESS',
|
||||
|
||||
@ -55,12 +55,12 @@
|
||||
/*
|
||||
* 先快速锁定当前窗口的
|
||||
*/
|
||||
useClientStore().setLockScreen(LockScreenStatus.LOCK);
|
||||
// useClientStore().setLockScreen(LockScreenStatus.LOCK);
|
||||
/*
|
||||
* 通知设备下的窗口全部锁屏
|
||||
*/
|
||||
wsInstance.sendSystemMessage(WsSystemEvent.LOCK_CLIENT, {
|
||||
lockPassword: lockPassword.value
|
||||
password: lockPassword.value
|
||||
});
|
||||
visible.value = false;
|
||||
lockPassword.value = ''; // 清空密码
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ElNotification } from 'element-plus';
|
||||
import Swal from 'sweetalert2';
|
||||
import { LockScreenStatus, useClientStore } from '@/store/modules/client';
|
||||
class ScriptEvent {
|
||||
ElNotification(options = {}) {
|
||||
ElNotification(options);
|
||||
@ -19,8 +20,12 @@ class SystemEvent {
|
||||
/**
|
||||
* 登录成功事件
|
||||
*/
|
||||
loginSuccess(){
|
||||
|
||||
loginSuccess() {}
|
||||
/**
|
||||
* 锁定客户端
|
||||
*/
|
||||
lockClient() {
|
||||
useClientStore().setLockScreen(LockScreenStatus.LOCK);
|
||||
}
|
||||
trigger(name, data) {
|
||||
console.debug('ws.trigger#system', name, data);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user