yys 5 dagar sedan
förälder
incheckning
cbd4187ccc
1 ändrade filer med 4 tillägg och 3 borttagningar
  1. 4 3
      src/views/live/liveData/index.vue

+ 4 - 3
src/views/live/liveData/index.vue

@@ -910,9 +910,10 @@ export default {
     /** 格式化时长 */
     formatDuration(seconds) {
       if (!seconds) return '00:00:00';
-      const hours = Math.floor(seconds / 3600);
-      const minutes = Math.floor((seconds % 3600) / 60);
-      const secs = seconds % 60;
+      const total = Math.floor(Number(seconds) || 0);
+      const hours = Math.floor(total / 3600);
+      const minutes = Math.floor((total % 3600) / 60);
+      const secs = total % 60;
       return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(secs).padStart(2, '0')}`;
     },
     /** 更新完课时长设置 */