up. 优化代码内容
This commit is contained in:
parent
8bd63a863f
commit
dd58648a49
@ -9,7 +9,7 @@ namespace app\enum\gateway\message;
|
|||||||
enum SystemEnum: string
|
enum SystemEnum: string
|
||||||
{
|
{
|
||||||
case Login = 'login';
|
case Login = 'login';
|
||||||
case Login_SUCCESS = 'login_success';
|
case Login_SUCCESS = 'loginSuccess';
|
||||||
case Lock_Client = 'lock_client';
|
case Lock_Client = 'lockClient';
|
||||||
case Client_quit_room = 'client_quit_room';
|
case Client_quit_room = 'clientQuitRoom';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { wsInstance, WsSendEventType } from '@/plugins/websocket';
|
import {wsInstance, WsSendEventType, WsSystemEvent} from '@/plugins/websocket';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { LockScreenStatus, useClientStore } from '@/store/modules/client';
|
import { LockScreenStatus, useClientStore } from '@/store/modules/client';
|
||||||
|
|
||||||
@ -59,7 +59,7 @@
|
|||||||
/*
|
/*
|
||||||
* 通知设备下的窗口全部锁屏
|
* 通知设备下的窗口全部锁屏
|
||||||
*/
|
*/
|
||||||
wsInstance.sendMessage(WsSendEventType.LOCK_CLIENT_SCREEN, {
|
wsInstance.sendSystemMessage(WsSystemEvent.LOCK_CLIENT, {
|
||||||
lockPassword: lockPassword.value
|
lockPassword: lockPassword.value
|
||||||
});
|
});
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
|
|||||||
@ -16,6 +16,12 @@ class ScriptEvent {
|
|||||||
export const scriptEvent: ScriptEvent = new ScriptEvent();
|
export const scriptEvent: ScriptEvent = new ScriptEvent();
|
||||||
|
|
||||||
class SystemEvent {
|
class SystemEvent {
|
||||||
|
/**
|
||||||
|
* 登录成功事件
|
||||||
|
*/
|
||||||
|
loginSuccess(){
|
||||||
|
|
||||||
|
}
|
||||||
trigger(name, data) {
|
trigger(name, data) {
|
||||||
console.debug('ws.trigger#system', name, data);
|
console.debug('ws.trigger#system', name, data);
|
||||||
this[name]?.(data);
|
this[name]?.(data);
|
||||||
|
|||||||
@ -6,7 +6,8 @@ export enum WsEvent {
|
|||||||
LOCK_CLIENT_SCREEN = 'LOCK_CLIENT_SCREEN'
|
LOCK_CLIENT_SCREEN = 'LOCK_CLIENT_SCREEN'
|
||||||
}
|
}
|
||||||
export enum WsSystemEvent {
|
export enum WsSystemEvent {
|
||||||
LOGIN = 'login'
|
LOGIN = 'login',
|
||||||
|
LOCK_CLIENT = 'lockClient'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user