Преглед изворни кода

更新service worker的缓存版本,移除VideoJSPlayer组件和路由中的调试日志,优化主页状态管理逻辑,提升代码整洁性和用户体验。

wuyi пре 2 месеци
родитељ
комит
d62a35be40
4 измењених фајлова са 1 додато и 8 уклоњено
  1. 1 1
      dev-dist/sw.js
  2. 0 1
      src/components/VideoJSPlayer.vue
  3. 0 1
      src/router/index.ts
  4. 0 5
      src/views/Home.vue

+ 1 - 1
dev-dist/sw.js

@@ -79,7 +79,7 @@ define(['./workbox-f2cb1a81'], (function (workbox) { 'use strict';
    */
   workbox.precacheAndRoute([{
     "url": "index.html",
-    "revision": "0.t1ek31rf02g"
+    "revision": "0.e5rshanlf6o"
   }], {});
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

+ 0 - 1
src/components/VideoJSPlayer.vue

@@ -547,7 +547,6 @@ watch(
   () => props.m3u8Url,
   (newUrl, oldUrl) => {
     if (oldUrl && newUrl !== oldUrl) {
-      console.log("视频URL变化,停止当前播放并加载新视频", { newUrl, oldUrl });
       stopVideo();
       if (newUrl) {
         processVideo(newUrl);

+ 0 - 1
src/router/index.ts

@@ -87,7 +87,6 @@ router.beforeEach((to, from, next) => {
     to.name === "Home" &&
     from.meta.returnFromVideo
   ) {
-    console.log("检测到从视频页返回到主页,保留returnFromVideo标记");
     // 将标记传递给目标路由
     to.meta.returnFromVideo = true;
   }

+ 0 - 5
src/views/Home.vue

@@ -643,8 +643,6 @@ const saveCurrentState = () => {
   // 保存当前滚动位置
   const scrollPosition = window.scrollY || document.documentElement.scrollTop;
 
-  console.log("保存主页状态,当前视频列表长度:", videoList.value.length);
-
   userStore.saveHomePageState({
     selectedMenu: selectedMenu.value,
     currentPage: currentPage.value,
@@ -661,7 +659,6 @@ const saveCurrentState = () => {
 // 恢复保存的浏览状态
 const restoreSavedState = async () => {
   const savedState = userStore.getHomePageState();
-  console.log("恢复主页状态:", savedState);
 
   // 恢复状态
   selectedMenu.value = savedState.selectedMenu;
@@ -672,14 +669,12 @@ const restoreSavedState = async () => {
 
   // 直接使用已保存的视频列表数据,不重新调用API
   if (savedState.videoList && savedState.videoList.length > 0) {
-    console.log("使用已保存的视频列表数据,不重新调用API");
     videoList.value = savedState.videoList;
     totalPages.value = savedState.totalPages || 0;
     totalCount.value = savedState.totalCount || 0;
 
     // 使用setTimeout确保DOM完全更新后再滚动
     setTimeout(() => {
-      console.log("恢复滚动位置:", savedState.scrollPosition);
       window.scrollTo({
         top: savedState.scrollPosition,
         behavior: "auto",