浏览代码

日常开发

linxuxiang 4 周之前
父节点
当前提交
1f40146b0c
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/utils/trainWs.ts

+ 6 - 6
src/utils/trainWs.ts

@@ -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
       },
-      () => {}
+      () => { }
     );
   }