diff --git a/docs/手动部署文档.md b/docs/手动部署文档.md index f27a929..1810f61 100644 --- a/docs/手动部署文档.md +++ b/docs/手动部署文档.md @@ -157,6 +157,20 @@ server { add_header X-Content-Type-Options nosniff; add_header X-Frame-Options SAMEORIGIN; add_header X-XSS-Protection "1; mode=block"; + + location /pansou/ { + rewrite ^/pansou/(.*)$ /$1 break; # 移除 /pansou 前缀 + proxy_pass https://pansou.252035.xyz; + proxy_set_header Host pansou.252035.xyz; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"; + proxy_connect_timeout 15s; + proxy_read_timeout 45s; + proxy_send_timeout 15s; + proxy_buffering off; + } # CORS代理端点 - 注意这与前端请求的路径完全匹配 /proxy location = /proxy { diff --git a/frontend/public/sitemap.xml b/frontend/public/sitemap.xml index 19f7657..af87108 100644 --- a/frontend/public/sitemap.xml +++ b/frontend/public/sitemap.xml @@ -2,19 +2,19 @@ https://dm.xueximeng.com/ - 2025-07-09 + 2025-07-16 daily 1 https://dm.xueximeng.com/submit - 2025-07-09 + 2025-07-16 weekly 0.8 https://dm.xueximeng.com/about - 2025-07-09 + 2025-07-16 monthly 0.7 @@ -55,14 +55,14 @@ 0.9 - https://dm.xueximeng.com/resource/82 - 2025-07-07 + https://dm.xueximeng.com/resource/5 + 2025-07-06 weekly 0.9 - https://dm.xueximeng.com/resource/5 - 2025-07-06 + https://dm.xueximeng.com/resource/82 + 2025-07-07 weekly 0.9 @@ -78,12 +78,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/10 - 2025-06-18 - weekly - 0.9 - https://dm.xueximeng.com/resource/30 2025-06-27 @@ -91,20 +85,14 @@ 0.9 - https://dm.xueximeng.com/resource/26 - 2025-06-19 - weekly - 0.9 - - - https://dm.xueximeng.com/resource/31 + https://dm.xueximeng.com/resource/10 2025-06-18 weekly 0.9 - https://dm.xueximeng.com/resource/8 - 2025-06-20 + https://dm.xueximeng.com/resource/26 + 2025-06-19 weekly 0.9 @@ -120,6 +108,18 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/31 + 2025-06-18 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/8 + 2025-06-20 + weekly + 0.9 + https://dm.xueximeng.com/resource/28 2025-06-27 @@ -156,6 +156,12 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/38 + 2025-06-25 + weekly + 0.9 + https://dm.xueximeng.com/resource/47 2025-06-27 @@ -198,12 +204,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/38 - 2025-06-25 - weekly - 0.9 - https://dm.xueximeng.com/resource/48 2025-06-20 @@ -222,6 +222,18 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/107 + 2025-07-06 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/185 + 2025-07-16 + weekly + 0.9 + https://dm.xueximeng.com/resource/1 2025-06-19 @@ -234,6 +246,12 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/27 + 2025-06-21 + weekly + 0.9 + https://dm.xueximeng.com/resource/29 2025-06-20 @@ -306,12 +324,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/107 - 2025-07-06 - weekly - 0.9 - https://dm.xueximeng.com/resource/124 2025-06-19 @@ -332,7 +344,7 @@ https://dm.xueximeng.com/resource/15 - 2025-07-03 + 2025-07-16 weekly 0.9 @@ -342,12 +354,6 @@ weekly 0.9 - - https://dm.xueximeng.com/resource/27 - 2025-06-21 - weekly - 0.9 - https://dm.xueximeng.com/resource/33 2025-06-04 @@ -462,6 +468,18 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/180 + 2025-07-09 + weekly + 0.9 + + + https://dm.xueximeng.com/resource/184 + 2025-07-14 + weekly + 0.9 + https://dm.xueximeng.com/resource/17 2025-06-15 @@ -830,7 +848,7 @@ https://dm.xueximeng.com/resource/161 - 2025-06-26 + 2025-07-09 weekly 0.9 @@ -854,7 +872,7 @@ https://dm.xueximeng.com/resource/166 - 2025-07-05 + 2025-07-10 weekly 0.9 @@ -936,4 +954,10 @@ weekly 0.9 + + https://dm.xueximeng.com/resource/181 + 2025-07-09 + weekly + 0.9 + \ No newline at end of file diff --git a/frontend/public/test-settings-api.html b/frontend/public/test-settings-api.html new file mode 100644 index 0000000..6b422f4 --- /dev/null +++ b/frontend/public/test-settings-api.html @@ -0,0 +1,216 @@ + + + + + + 测试设置API + + + +

设置API测试工具

+ +
+

测试页脚设置API

+

这个工具可以帮助您测试页脚设置API,发送PUT请求到 /api/settings/footer 端点。

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + + + \ No newline at end of file diff --git a/frontend/src/styles/ResourceDetail.css b/frontend/src/styles/ResourceDetail.css index 571c795..d5165b2 100644 --- a/frontend/src/styles/ResourceDetail.css +++ b/frontend/src/styles/ResourceDetail.css @@ -385,7 +385,7 @@ padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(124, 58, 237, 0.1); position: relative; - overflow: hidden; + overflow: visible; /* 修改为visible,确保不会截断header-actions中的按钮 */ display: flex; justify-content: space-between; align-items: center; @@ -400,6 +400,7 @@ height: 100%; background: linear-gradient(45deg, rgba(124, 58, 237, 0.07), transparent); opacity: 0.8; + z-index: 1; /* 添加z-index,确保在按钮下层 */ } .card-header h3 { @@ -410,6 +411,7 @@ position: relative; display: flex; align-items: center; + z-index: 2; /* 确保标题在背景上层 */ } .card-header h3::before { @@ -1307,6 +1309,7 @@ .card-header { padding: 1rem; + overflow: visible; /* 确保不会截断按钮 */ } .card-header h3 { @@ -1335,7 +1338,10 @@ } .table-body { - max-height: none; + max-height: 250px; /* 设置合适的高度,而不是none */ + overflow-y: auto; /* 保留自动滚动 */ + scrollbar-width: thin; /* 保留细滚动条 */ + -webkit-overflow-scrolling: touch; /* 增加iOS流畅滚动 */ } .col-link, .col-password, .col-note { @@ -1581,6 +1587,7 @@ .card-header { padding: 0.75rem; + overflow: visible; /* 确保不会截断按钮 */ } .card-header h3 { @@ -1696,7 +1703,7 @@ .link-item { padding: 0.5rem; } -} +} /* ===== 17. 贴纸容器样式 ===== */ .stickers-container { @@ -2138,6 +2145,24 @@ .links-list { margin-bottom: 1.5rem; + max-height: 400px; + overflow-y: auto; + scrollbar-width: thin; +} + +/* 为链接列表添加滚动条样式 */ +.links-list::-webkit-scrollbar { + width: 6px; +} + +.links-list::-webkit-scrollbar-track { + background: rgba(255, 255, 255, 0.2); + border-radius: 10px; +} + +.links-list::-webkit-scrollbar-thumb { + background: var(--primary-gradient); + border-radius: 10px; } .link-item { @@ -2238,6 +2263,12 @@ padding: 0.75rem; } + .links-list { + max-height: 350px; /* 移动端稍微减小高度 */ + overflow-y: auto; + -webkit-overflow-scrolling: touch; /* 增强移动端滚动体验 */ + } + .link-inputs { display: flex; flex-direction: column; @@ -2294,4 +2325,141 @@ .link-item { padding: 0.5rem; } +} + +/* ===== 19. 网盘搜索功能样式 ===== */ +/* 标题栏中的操作按钮容器 */ +.header-actions { + display: flex; + align-items: center; + gap: 10px; + position: relative; + z-index: 10; /* 确保按钮在最上层 */ +} + +/* 网盘搜索按钮 */ +.pan-search-button { + background-color: #6c757d; + color: white; + border: none; + border-radius: 4px; + padding: 5px 15px; + display: flex; + align-items: center; + font-weight: bold; + cursor: pointer; + transition: background-color 0.2s; + position: relative; + z-index: 20; /* 确保按钮在最上层 */ +} + +.pan-search-button:hover { + background-color: #5a6268; +} + +.pan-search-button:disabled { + opacity: 0.7; + cursor: not-allowed; +} + +.pan-search-button i { + margin-right: 5px; +} + +/* 搜索结果指示器 */ +.search-results-indicator { + background-color: #f8f9fa; + border-left: 3px solid #007bff; + padding: 8px 15px; + margin-bottom: 15px; + font-size: 14px; + color: #6c757d; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: space-between; +} + +/* 异步更新指示器 */ +.async-update-indicator { + font-size: 12px; + color: #007bff; + display: flex; + align-items: center; + gap: 5px; +} + +/* 旋转动画 */ +.spin { + animation: spin 1.5s linear infinite; +} + +/* 空搜索结果提示 */ +.empty-search-results { + background-color: #f8f9fa; + border: 1px solid #e9ecef; + border-radius: 4px; + padding: 20px; + text-align: center; + color: #6c757d; + margin: 15px 0; +} + +.empty-search-results i { + font-size: 24px; + margin-right: 10px; + color: #dc3545; +} + +/* 搜索错误消息 */ +.search-error-message { + background-color: #f8d7da; + border: 1px solid #f5c6cb; + border-radius: 4px; + padding: 10px 15px; + margin-bottom: 15px; + color: #721c24; + display: flex; + align-items: center; + gap: 10px; +} + +.search-error-message i { + font-size: 18px; + color: #dc3545; +} + +/* 网盘搜索功能的响应式适配 */ +@media (max-width: 768px) { + /* .header-actions { + flex-direction: row; + gap: 8px; + } */ + + .pan-search-button, .stream-button { + padding: 4px 10px; + font-size: 0.9rem; + } + + .links-list { + max-height: 350px; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + } +} + +@media (max-width: 576px) { + /* .header-actions { + flex-direction: row; + width: 100%; + gap: 6px; + margin-top: 8px; + } */ + + .pan-search-button, .stream-button { + width: auto; /* 不要占满整行 */ + justify-content: center; + padding: 4px 8px; + font-size: 0.85rem; + } } \ No newline at end of file diff --git a/frontend/src/utils/pansouService.js b/frontend/src/utils/pansouService.js new file mode 100644 index 0000000..130e69e --- /dev/null +++ b/frontend/src/utils/pansouService.js @@ -0,0 +1,122 @@ +import axios from 'axios'; + +// 创建一个专用于网盘搜索的axios实例,避免全局配置影响 +const pansouAxios = axios.create({ + baseURL: '', // 显式设置为空,避免继承全局baseURL + timeout: 10000 // 10秒超时 +}); + +/** + * 搜索网盘资源 + * @param {string} keyword - 搜索关键词 + * @param {boolean} refresh - 是否刷新结果 + * @param {Function} onUpdate - 结果更新时的回调函数 + * @param {Function} onComplete - 异步更新完成后的回调函数 + * @returns {Promise} 搜索结果 + */ +export const searchPanResources = async (keyword, refresh = false, onUpdate = null, onComplete = null) => { + console.log('pansouService: 开始搜索关键词:', keyword); + + if (!keyword || keyword.trim() === '') { + console.error('搜索关键词为空'); + return {}; + } + + try { + // 确保直接调用/pansou/api/search而不是通过/app前缀 + const requestUrl = `/pansou/api/search?kw=${encodeURIComponent(keyword)}&refresh=${refresh}&res=merge&src=all`; + console.log('pansouService: 发送API请求到:', requestUrl); + console.log('pansouService: 完整URL应为:', window.location.origin + requestUrl); + + const response = await pansouAxios.get(`/pansou/api/search`, { + params: { + kw: keyword, + refresh: refresh, + res: 'merge', + src: 'all' + } + }); + + console.log('pansouService: API响应:', response); + + if (response.data.code === 0 && response.data.message === 'success') { + const results = response.data.data.merged_by_type || {}; + console.log('pansouService: 搜索成功, 返回结果:', results); + + // 如果是首次搜索且有回调函数,则异步再次请求更新结果 + if (!refresh && typeof onUpdate === 'function') { + console.log('pansouService: 将在4秒后异步更新搜索结果'); + setTimeout(async () => { + try { + console.log('pansouService: 开始异步更新搜索结果'); + const updatedResults = await searchPanResources(keyword, false); + console.log('pansouService: 异步更新完成,新结果:', updatedResults); + onUpdate(updatedResults); + + // 调用完成回调 + if (typeof onComplete === 'function') { + onComplete(); + } + } catch (error) { + console.error('pansouService: 异步更新失败:', error); + // 即使失败也调用完成回调 + if (typeof onComplete === 'function') { + onComplete(); + } + } + }, 4000); // 4秒后再次请求 + } + + return results; + } + + console.warn('pansouService: API返回错误码:', response.data); + return {}; + } catch (error) { + console.error('搜索网盘资源失败:', error); + if (error.response) { + // 服务器响应了,但状态码不在2xx范围内 + console.error('响应状态:', error.response.status); + console.error('响应数据:', error.response.data); + } else if (error.request) { + // 请求已发送,但没有收到响应 + console.error('请求已发送,但没有收到响应:', error.request); + } else { + // 在设置请求时发生了错误 + console.error('请求设置错误:', error.message); + } + return {}; + } +}; + +// 将API返回的资源转换为与系统兼容的格式 +export const convertToResourceLinks = (panResources) => { + console.log('pansouService: 开始转换资源格式, 输入:', panResources); + + if (!panResources || typeof panResources !== 'object') { + console.warn('pansouService: 无效的资源数据'); + return {}; + } + + const result = {}; + + try { + // 处理每种网盘类型 - 无需映射,直接使用 + Object.keys(panResources).forEach(type => { + if (Array.isArray(panResources[type])) { + // 转换每个链接 + result[type] = panResources[type].map(item => ({ + url: item.url || '', + password: item.password || '', + note: item.note || '', + })); + } + }); + + console.log('pansouService: 转换完成, 输出:', result); + return result; + } catch (error) { + console.error('pansouService: 转换资源格式失败:', error); + return {}; + } +}; \ No newline at end of file diff --git a/frontend/src/views/ResourceDetail.vue b/frontend/src/views/ResourceDetail.vue index 5bf0648..ca8d8dd 100755 --- a/frontend/src/views/ResourceDetail.vue +++ b/frontend/src/views/ResourceDetail.vue @@ -535,17 +535,51 @@