|
@@ -243,14 +243,14 @@ export function useWs() {
|
|
|
*/
|
|
|
function sendMessage(type: string, data: any, callback?: () => void) {
|
|
|
if (socket?.connected) {
|
|
|
- callback = callback || function () {};
|
|
|
+ callback = callback || function () { };
|
|
|
//版本2就拼接进去
|
|
|
if (version == 'v2') {
|
|
|
type = type + '_' + version;
|
|
|
}
|
|
|
- if (['task_starts','exam_starts','msgfrom_frontend','exam_ends','task_starts_v2','exam_starts_v2','msgfrom_frontend_v2','exam_ends_v2'].includes(type)) {
|
|
|
- console.log(`【发送:${type}】`, JSON.stringify(data))
|
|
|
- }
|
|
|
+ if (['task_starts', 'exam_starts', 'msgfrom_frontend', 'exam_ends', 'task_starts_v2', 'exam_starts_v2', 'msgfrom_frontend_v2', 'exam_ends_v2'].includes(type)) {
|
|
|
+ console.log(`【发送:${type}】`, JSON.stringify(data))
|
|
|
+ }
|
|
|
socket.emit(type, JSON.stringify(data), callback);
|
|
|
}
|
|
|
}
|
|
@@ -272,7 +272,7 @@ export function useWs() {
|
|
|
demo: parameter.demo,
|
|
|
test_time: testTime
|
|
|
},
|
|
|
- () => {}
|
|
|
+ () => { }
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -291,7 +291,7 @@ export function useWs() {
|
|
|
demo: parameter.demo,
|
|
|
test_time: testTime
|
|
|
},
|
|
|
- () => {}
|
|
|
+ () => { }
|
|
|
);
|
|
|
}
|
|
|
|