From 8e3b385dd9df2ededa6263a58ac0d304211b0710 Mon Sep 17 00:00:00 2001 From: "www.xueximeng.com" Date: Thu, 7 Aug 2025 19:06:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 165 +--- frontend/.env.production | 2 +- frontend/public/sitemap.xml | 288 +++--- frontend/src/App.vue | 28 + frontend/src/components/DraggableSticker.vue | 2 +- frontend/src/components/EpisodeSelector.vue | 2 +- frontend/src/components/ShareResource.vue | 2 +- frontend/src/components/StickerManager.vue | 2 +- frontend/src/styles/admin.css | 411 +++++---- frontend/src/views/Admin.vue | 7 + gobackend/README.md | 7 +- gobackend/cmd/api/main.go | 41 +- gobackend/cmd/diagnostic/main.go | 382 -------- gobackend/cmd/test/sqlite.go | 118 --- gobackend/cmd/test/webp_tool_test.go | 85 -- gobackend/cmd/webp/main.go | 2 +- gobackend/internal/config/config.go | 70 +- gobackend/internal/handlers/auth_handlers.go | 2 - .../internal/handlers/imgenhancer_handler.go | 2 +- gobackend/internal/handlers/middleware.go | 3 +- .../internal/handlers/resource_approval.go | 5 +- .../internal/handlers/resource_handlers.go | 16 +- .../handlers/site_settings_handlers.go | 1 - .../internal/handlers/tmdb_season_handlers.go | 2 +- gobackend/internal/models/database.go | 283 +----- gobackend/internal/utils/config.go | 73 -- gobackend/internal/utils/image_utils.go | 7 +- sitemap-generator/README.md | 85 -- sitemap-generator/go.mod | 11 - sitemap-generator/go.sum | 8 - sitemap-generator/main.go | 826 ------------------ sitemap-generator/public/sitemap.xml | 189 ---- 32 files changed, 578 insertions(+), 2549 deletions(-) delete mode 100644 gobackend/cmd/diagnostic/main.go delete mode 100644 gobackend/cmd/test/sqlite.go delete mode 100644 gobackend/cmd/test/webp_tool_test.go delete mode 100644 gobackend/internal/utils/config.go delete mode 100644 sitemap-generator/README.md delete mode 100644 sitemap-generator/go.mod delete mode 100644 sitemap-generator/go.sum delete mode 100644 sitemap-generator/main.go delete mode 100644 sitemap-generator/public/sitemap.xml diff --git a/README.md b/README.md index 61a5bc7..3efda4e 100644 --- a/README.md +++ b/README.md @@ -35,35 +35,47 @@ docker run -d --name dongman \ ``` -## 适配移动端样式 -移动端也可以更好的体验美漫共建小站了 - -![移动端|237x499](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/1.gif) - ## 首页 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/2.jpg) - -可以根据资源中文名、英文名、简介进行搜索 -![首页|690x392](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/3.gif) +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/1.jpg) ## 详情页 -![image|690x398](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/4.jpg) -可以切换查看图片,选择网盘标签,一键复制网盘链接密码 -![详情页|690x392](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/5.gif) -## 关于本站 -![关于|690x392](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/6.gif) +点击「盘搜」按钮,一键搜索各种网盘资源 + +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/pansou.gif) + +点击「剧集探索」按钮,可以查看分季分集信息 +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/30.gif) + +可以一键生成分享海报和链接 +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/29.gif) + +一键在线点播 + +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/dianbo.gif) + +也可以直接在`https://域名/streams`页面点播,支持解析线路和自定义爬虫 + +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/streams.gif) + + + +## 全面支持管理后台设置网站信息和采集解析源 +目前美漫共建官网内置30条数据源 +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/26.gif) + +## 支持外挂在线播放数据源(自定义爬虫) +会写爬虫的用户可以自己添加数据源,更加灵活。参考[外接数据源开发者文档](https://github.com/fish2018/GoComicMosaic/blob/main/docs/%E5%A4%96%E6%8E%A5%E6%95%B0%E6%8D%AE%E6%BA%90%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3.md),提供[爬虫示例及模板](https://github.com/fish2018/GoComicMosaic/tree/main/docs/%E5%A4%96%E6%8E%A5%E6%95%B0%E6%8D%AE%E6%BA%90%E7%A4%BA%E4%BE%8B%E5%8F%8A%E6%A8%A1%E6%9D%BF) +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/27.gif) ## 提交资源 这个才是资源共建平台的核心,点击右上角的'提交资源',用户可以随意提交自己喜欢的动漫资源,如果网站还不存该美漫时,会是一个新建资源的表单,需要填写中文名、英文名、类型、简介等基础信息。提交后,要等管理员在后台审批完才会在首页显示 ### 提交-新建资源 -![image|690x384](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/7.jpg) -![image|690x379](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/8.jpg) -网盘链接和图片都可以提交多个 -![提交资源|690x392](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/9.gif) +支持从TMDB搜索、预览、一键导入资源 +![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/28.gif) ### 提交-补充资源 顾名思义,就是对已经存在的动漫资源补充一些信息,主要是图片、资源链接 @@ -75,11 +87,6 @@ docker run -d --name dongman \ 从资源详情页点击'补充资源'按钮,不用自己再搜索选择了,自动绑定对应的动漫 ![详情页补充|690x392](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/12.gif) -## 管理员登录 -不用多说了,就是输入账号密码,初始密码登录后可修改 - -![image|690x401](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/13.jpg) - ## 管理控制台 主要用于审批用户提交的资源 @@ -95,120 +102,8 @@ docker run -d --name dongman \ ![详情编辑|690x391](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/18.gif) -## 新增喜欢按钮 -在详情页可以点击喜欢 -![image|690x370](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/19.jpg) -首页可以根据喜欢数量排序,默认按最新发布排序 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/20.jpg) -## 新增分页 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/21.jpg) -## 新增在线点播功能 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/22.gif) -## 优化检测 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/23.jpg) -## 调整底栏 -- 添加在线点播 -- 添加访问统计 -- 添加友链 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/24.jpg) -## 详情页剧照点击放大查看 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/25.gif) - -## 全面支持管理后台设置网站信息和采集解析源 -目前美漫共建官网内置30条数据源 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/26.gif) - -## 支持外挂在线播放数据源 -会写爬虫的用户可以自己添加数据源,更加灵活。参考[外接数据源开发者文档](https://github.com/fish2018/GoComicMosaic/blob/main/docs/%E5%A4%96%E6%8E%A5%E6%95%B0%E6%8D%AE%E6%BA%90%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3.md),提供[爬虫示例及模板](https://github.com/fish2018/GoComicMosaic/tree/main/docs/%E5%A4%96%E6%8E%A5%E6%95%B0%E6%8D%AE%E6%BA%90%E7%A4%BA%E4%BE%8B%E5%8F%8A%E6%A8%A1%E6%9D%BF) -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/27.gif) - -## 支持从TMDB一键导入资源库 -可以从TMDB搜索、预览、一键导入资源 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/28.gif) - -## 支持一键分享 -资源详情页可以一键生成分享海报和链接 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/29.gif) - -## 新增「剧集探索」功能,支持查看分季分集信息 -资源详情页可以一键生成分享海报和链接 -![image|690x397](https://raw.githubusercontent.com/fishforks/imgs/refs/heads/main/gcm/30.gif) - ---- - -# 更新日志 --202507162228 -✅ 集成网盘搜索功能,资源详情页点击`盘搜`按钮可以自动搜索各类网盘链接 --202507161526 -✅ 优化TMDB搜索,显示结果列表页,选择具体资源后再显示详情,支持电影搜索 -✅ 变更访问人数统计工具 --202507091318 -✅ 新增贴纸功能,可以在详情页显示透明贴纸,用户自由拖拽、旋转 --202507061001 -✅ 外接数据源开发支持跨域代理返回Cookies功能 -✅ 外接数据源开发支持桥接存储 (localStorage) -✅ 外接数据源开发支持二次请求播放地址支持 (getPlayUrl) -✅ 优化数据源加载机制,只有在流媒体播放页面切换数据源时才开始加载 -✅ 新增bilibili外接数据源 -✅ 内置一键图片清晰AI工具 -✅ 调整vite.config.js配置proxy为`/app`(原`/api`),避免歧义 --202506230806 -✅ 新增文章功能,支持markdown -✅ 图片支持拖拽排序 -✅ 支持通过链接添加图片 --202506211815 -✅ 新增滑动切换图片功能,对移动端体验友好 -✅ 调整网盘显示顺序 --202506211422 -✅ 大幅优化「剧集探索」加载速度,切换季、集、剧照更丝滑 -✅ 在线点播页面新增主页推荐功能 --202506191159 -✅ 新增「剧集探索」功能,支持查看电视剧分季和分集信息 --202506180813 -✅ 后台网站设置增加免责声明模块,支持html代码 -✅ 播放器增加倍速选择、增加快捷键功能 --202506151233 -✅ TMDB搜索后支持直接编辑,然后再一键导入 -✅ 调整TMDB搜索预览界面,和实际资源详情页保持风格一致 --202506141634 -✅ 去掉点播时的质量设置,提升加载速度 -✅ 播放器界面切换数据源时,不再自动搜索 -✅ 资源详情页大图预览区限制高度,避免出现竖图时过于突兀 -✅ 梳理文档,集中放到docs目录下 --202506121410 -✅ 后端跨域转发代理支持所有请求方法,支持透传headers -✅ 重新优化外接数据源,解决跨域问题,提供外接数据源爬虫示例lanmei.js、rebo.js和模板 --202506112021 -✅ 修复TMDB_API_KEY泄露问题 -✅ 详情页增加一键分享功能 -✅ 修复GO使用sqlite3时开启WAL导致数据丢失问题 --202506100835 -✅ 后台读取到环境变量配置的TMDB_API_KEY会自动保存到数据库 -✅ 支持开启/关闭TMDB功能,自由控制顶栏显示 --202506091954 -✅ 支持从TMDB一键导入资源库 -✅ 支持从环境变量、管理后台配置TDMB_API_KEY --202506081248 -✅ 后台网站设置改为标签切换配置 -✅ 后台支持配置采集解析数据源 -✅ 拆分独立CSS文件 -✅ 独立icon文件,包含2000多图标 --202506071917 -✅ 全面支持管理后台设置网站信息 --202506061607 -✅ 优化悬浮按钮样式问题 -✅ 修复最近播放恢复播放失败问题 -✅ 新增的资源,如果没有批准任何图片和链接,则代表审核不通过,直接删除该条数据 -✅ 修复编辑资源时,将新上传的图片设置为海报失败问题 --2020506051132 -✅ 增加golang版动态生成sitemap工具`sitemap-generator`,为将来容器化做准备 -✅ 允许通过环境变量指定assets和数据库路径,为将来容器化做准备 -✅ 自动判断vite.config.js中是否需要启用`base: '/static/',`,只有正式编译时启用,本地开发不会启用,避免每次编译手动修改一遍 -✅ 使用express代理访问本地静态资源路径,根据.env.production配置中的ASSETS_PATH自动设置,默认路径'../assets' -✅ 调整后台所有图片预览模态框,保持全站风格一致,审批通过的图片,点击也可以放大看 -✅ 优化搜索框样式 diff --git a/frontend/.env.production b/frontend/.env.production index cc425ce..34814f2 100755 --- a/frontend/.env.production +++ b/frontend/.env.production @@ -1,3 +1,3 @@ BASE_URL=https://dm.xueximeng.com ASSETS_PATH=../assets -# ASSETS_PATH=../data/assets \ No newline at end of file +#ASSETS_PATH=../data/assets diff --git a/frontend/public/sitemap.xml b/frontend/public/sitemap.xml index 1516a67..1c0b016 100644 --- a/frontend/public/sitemap.xml +++ b/frontend/public/sitemap.xml @@ -2,25 +2,25 @@ https://dm.xueximeng.com/ - 2025-07-19 + 2025-08-07 daily 1 https://dm.xueximeng.com/submit - 2025-07-19 + 2025-08-07 weekly 0.8 https://dm.xueximeng.com/about - 2025-07-19 + 2025-08-07 monthly 0.7 https://dm.xueximeng.com/resource/11 - 2025-07-17 + 2025-07-26 weekly 0.9 @@ -38,7 +38,7 @@ https://dm.xueximeng.com/resource/46 - 2025-06-27 + 2025-07-25 weekly 0.9 @@ -68,7 +68,7 @@ https://dm.xueximeng.com/resource/82 - 2025-07-07 + 2025-08-07 weekly 0.9 @@ -78,6 +78,12 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/10 + 2025-08-04 + weekly + 0.9 + https://dm.xueximeng.com/resource/30 2025-06-27 @@ -85,14 +91,14 @@ 0.9 - https://dm.xueximeng.com/resource/10 - 2025-06-18 + https://dm.xueximeng.com/resource/26 + 2025-07-18 weekly 0.9 - https://dm.xueximeng.com/resource/26 - 2025-07-18 + https://dm.xueximeng.com/resource/23 + 2025-07-29 weekly 0.9 @@ -109,14 +115,20 @@ 0.9 - https://dm.xueximeng.com/resource/23 - 2025-06-27 + https://dm.xueximeng.com/resource/31 + 2025-06-18 weekly 0.9 - https://dm.xueximeng.com/resource/31 - 2025-06-18 + https://dm.xueximeng.com/resource/55 + 2025-06-20 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/7 + 2025-08-01 weekly 0.9 @@ -128,7 +140,7 @@ https://dm.xueximeng.com/resource/37 - 2025-07-07 + 2025-07-28 weekly 0.9 @@ -139,14 +151,26 @@ 0.9 - https://dm.xueximeng.com/resource/55 - 2025-06-20 + https://dm.xueximeng.com/resource/47 + 2025-07-30 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/107 + 2025-07-06 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/109 + 2025-07-29 weekly 0.9 https://dm.xueximeng.com/resource/137 - 2025-06-23 + 2025-07-20 weekly 0.9 @@ -169,20 +193,32 @@ 0.9 - https://dm.xueximeng.com/resource/47 - 2025-06-27 + https://dm.xueximeng.com/resource/48 + 2025-06-20 weekly 0.9 - https://dm.xueximeng.com/resource/107 - 2025-07-06 + https://dm.xueximeng.com/resource/61 + 2025-07-27 weekly 0.9 - https://dm.xueximeng.com/resource/109 - 2025-06-27 + https://dm.xueximeng.com/resource/161 + 2025-07-17 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/184 + 2025-07-18 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/185 + 2025-07-16 weekly 0.9 @@ -193,14 +229,20 @@ 0.9 - https://dm.xueximeng.com/resource/7 - 2025-06-22 + https://dm.xueximeng.com/resource/16 + 2025-07-22 weekly 0.9 - https://dm.xueximeng.com/resource/16 - 2025-06-19 + https://dm.xueximeng.com/resource/27 + 2025-07-26 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/29 + 2025-06-20 weekly 0.9 @@ -210,12 +252,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/48 - 2025-06-20 - weekly - 0.9 - https://dm.xueximeng.com/resource/75 2025-06-27 @@ -235,14 +271,14 @@ 0.9 - https://dm.xueximeng.com/resource/184 - 2025-07-18 + https://dm.xueximeng.com/resource/99 + 2025-08-05 weekly 0.9 - https://dm.xueximeng.com/resource/185 - 2025-07-16 + https://dm.xueximeng.com/resource/157 + 2025-07-30 weekly 0.9 @@ -252,24 +288,24 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/15 + 2025-07-16 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/21 + 2025-06-28 + weekly + 0.9 + https://dm.xueximeng.com/resource/22 2025-07-17 weekly 0.9 - - https://dm.xueximeng.com/resource/27 - 2025-06-21 - weekly - 0.9 - - - https://dm.xueximeng.com/resource/29 - 2025-06-20 - weekly - 0.9 - https://dm.xueximeng.com/resource/32 2025-06-20 @@ -294,15 +330,9 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/61 - 2025-06-27 - weekly - 0.9 - https://dm.xueximeng.com/resource/62 - 2025-06-21 + 2025-07-20 weekly 0.9 @@ -318,12 +348,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/99 - 2025-06-27 - weekly - 0.9 - https://dm.xueximeng.com/resource/104 2025-06-21 @@ -336,12 +360,42 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/162 + 2025-07-20 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/169 + 2025-07-02 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/174 + 2025-07-22 + weekly + 0.9 + https://dm.xueximeng.com/resource/180 2025-07-19 weekly 0.9 + + https://dm.xueximeng.com/resource/194 + 2025-07-26 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/196 + 2025-07-22 + weekly + 0.9 + https://dm.xueximeng.com/resource/2 2025-06-21 @@ -354,12 +408,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/15 - 2025-07-16 - weekly - 0.9 - https://dm.xueximeng.com/resource/20 2025-06-27 @@ -420,6 +468,12 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/70 + 2025-06-17 + weekly + 0.9 + https://dm.xueximeng.com/resource/74 2025-06-14 @@ -492,27 +546,9 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/157 - 2025-06-25 - weekly - 0.9 - https://dm.xueximeng.com/resource/159 - 2025-06-25 - weekly - 0.9 - - - https://dm.xueximeng.com/resource/161 - 2025-07-17 - weekly - 0.9 - - - https://dm.xueximeng.com/resource/162 - 2025-06-26 + 2025-08-07 weekly 0.9 @@ -523,14 +559,20 @@ 0.9 - https://dm.xueximeng.com/resource/169 - 2025-07-02 + https://dm.xueximeng.com/resource/173 + 2025-07-17 weekly 0.9 - https://dm.xueximeng.com/resource/174 - 2025-07-03 + https://dm.xueximeng.com/resource/187 + 2025-07-19 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/198 + 2025-07-29 weekly 0.9 @@ -546,12 +588,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/21 - 2025-06-28 - weekly - 0.9 - https://dm.xueximeng.com/resource/25 2025-05-31 @@ -596,7 +632,7 @@ https://dm.xueximeng.com/resource/63 - 2025-06-21 + 2025-07-20 weekly 0.9 @@ -612,12 +648,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/70 - 2025-06-17 - weekly - 0.9 - https://dm.xueximeng.com/resource/71 2025-06-16 @@ -626,7 +656,7 @@ https://dm.xueximeng.com/resource/72 - 2025-06-13 + 2025-07-22 weekly 0.9 @@ -662,7 +692,7 @@ https://dm.xueximeng.com/resource/96 - 2025-06-19 + 2025-07-26 weekly 0.9 @@ -782,7 +812,7 @@ https://dm.xueximeng.com/resource/132 - 2025-06-27 + 2025-07-30 weekly 0.9 @@ -836,13 +866,13 @@ https://dm.xueximeng.com/resource/151 - 2025-06-25 + 2025-07-24 weekly 0.9 https://dm.xueximeng.com/resource/152 - 2025-06-27 + 2025-07-25 weekly 0.9 @@ -918,12 +948,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/173 - 2025-07-17 - weekly - 0.9 - https://dm.xueximeng.com/resource/175 2025-07-03 @@ -960,15 +984,9 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/187 - 2025-07-18 - weekly - 0.9 - https://dm.xueximeng.com/resource/188 - 2025-07-18 + 2025-07-19 weekly 0.9 @@ -984,4 +1002,28 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/195 + 2025-07-26 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/197 + 2025-07-27 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/199 + 2025-08-07 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/202 + 2025-08-02 + weekly + 0.9 + \ No newline at end of file diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 31d70fd..2a03774 100755 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -500,6 +500,22 @@ onMounted(() => { checkAuthState(); + // 监听登录成功事件 + const handleLoginSuccess = () => { + checkAuthState(); + }; + window.addEventListener('login-success', handleLoginSuccess); + + // 监听TMDB配置更新事件 + const handleTmdbConfigUpdated = () => { + loadTMDBConfig(); + }; + window.addEventListener('tmdb-config-updated', handleTmdbConfigUpdated); + + // 将事件处理器保存到组件实例,以便在卸载时移除 + window.handleLoginSuccess = handleLoginSuccess; + window.handleTmdbConfigUpdated = handleTmdbConfigUpdated; + // 初始加载时设置meta信息 updateMetaInfo(route); @@ -565,6 +581,18 @@ onUnmounted(() => { window.removeEventListener('scroll', handleScroll); window.removeEventListener('beforeunload', clearPaginationStorage); + // 移除登录成功事件监听器 + if (window.handleLoginSuccess) { + window.removeEventListener('login-success', window.handleLoginSuccess); + delete window.handleLoginSuccess; + } + + // 移除TMDB配置更新事件监听器 + if (window.handleTmdbConfigUpdated) { + window.removeEventListener('tmdb-config-updated', window.handleTmdbConfigUpdated); + delete window.handleTmdbConfigUpdated; + } + // 移除路由监听 if (routeWatcher && typeof routeWatcher === 'function') { routeWatcher(); diff --git a/frontend/src/components/DraggableSticker.vue b/frontend/src/components/DraggableSticker.vue index a183e71..d697c6e 100644 --- a/frontend/src/components/DraggableSticker.vue +++ b/frontend/src/components/DraggableSticker.vue @@ -25,7 +25,7 @@