From 85b7d6f7623f4622f56917a87576c212635fc5cc Mon Sep 17 00:00:00 2001 From: 88531 <88531@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:01:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=98=8E=E7=A1=AE=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E9=99=90=E5=88=B6=20v1.7.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 小红书网页版评论框不支持图片(仅App支持),发送失败时页面弹提示(只弹一次) - 侧边栏图片模式显示橙色警告,引导改用自定义文字/AI模式 --- README.md | 11 +++++++---- background.js | 2 +- content.js | 19 +++++++++++++++---- manifest.json | 2 +- sidepanel.html | 2 +- sidepanel.js | 5 +++-- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index bf13b8e..1a2ea21 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > 一键搜索 · 自动点击 · 智能评论 —— 小红书运营引流的效率神器 -[![版本](https://img.shields.io/badge/版本-1.7.6-ff2442.svg)](https://dl.88531.cn/xhs.html) +[![版本](https://img.shields.io/badge/版本-1.7.7-ff2442.svg)](https://dl.88531.cn/xhs.html) [![平台](https://img.shields.io/badge/平台-Chrome%20%7C%20Edge-4caf50.svg)](#安装方法) [![语言](https://img.shields.io/badge/语言-纯%20JavaScript-2196f3.svg)](#开发说明) @@ -32,7 +32,7 @@ - **💬 评论方式**: - 固定评论池:循环发预设短评(👍 赞!/💯 太棒了!…) - 自定义文字:侧边栏文字库一行一条,循环发送 - - 图片回复:上传图片自动压缩存本地,预览/删除管理 + - 图片回复:上传图片自动压缩存本地,预览/删除管理(⚠️ 小红书网页版评论不支持图片,仅手机 App 支持,此模式仅供参考) - AI 按笔记生成:提示词可自定义(`{{content}}` 占位符),失败自动降级 - **📊 评论记录**:成功评论自动记录,今日/本月/总计统计,点击记录打开对应笔记 - **🔐 授权体系**:1 天试用(倒计时精确到秒)、卡密激活、插件内购买自动发卡 @@ -107,10 +107,13 @@ ## 📜 版本历史 -当前版本:**1.7.6** +当前版本:**1.7.7**
-展开查看完整变更记录(v1.2.0 ~ v1.7.6) +展开查看完整变更记录(v1.2.0 ~ v1.7.7) + +### 1.7.7 +- **明确图片评论限制**:小红书网页版评论框不支持发图片(仅手机 App 支持)。图片模式发送失败时页面弹出明确提示(只弹一次),侧边栏选项下方同步橙色警告,建议改用「自定义文字」或「AI」模式 ### 1.7.6 - **评论间隔随机化**:每条评论之间在设定范围内随机等待(默认 1~2 分钟,可自定义),进度条实时倒计时,模拟真人浏览节奏更安全 diff --git a/background.js b/background.js index c2a8d75..be42fe9 100644 --- a/background.js +++ b/background.js @@ -16,7 +16,7 @@ const DEFAULT_AI = { const AUTH_BASE = 'https://auth.88531.cn'; const AUTH_PROJECT_ID = 3; const AUTH_API_KEY = 'ak_bbf83b76df8219388d7f60b9e67c7db2'; -const CLIENT_VERSION = '1.7.6'; +const CLIENT_VERSION = '1.7.7'; const TRIAL_MS = 24 * 60 * 60 * 1000; // 未授权试用1天 // 把用户填写的地址规范化为完整的 chat/completions 端点 diff --git a/content.js b/content.js index 770bd7d..cf224e4 100644 --- a/content.js +++ b/content.js @@ -21,6 +21,7 @@ class XHSNoteSaver { this.customComments = []; // 固定评论池 this.currentCommentIndex = 0; // 当前评论索引 this.currentImageIndex = 0; // 当前图片索引(图片回复模式) + this.imageCommentWarned = false; // 图片失败提示只弹一次 this.init(); } @@ -1603,9 +1604,19 @@ class XHSNoteSaver { let sentComment = ''; let sentImage = null; if (this.commentMode === 'image') { - sentImage = await this.uploadCommentImage(); - sentComment = '[图片]'; - console.log('评论图片已添加'); + try { + sentImage = await this.uploadCommentImage(); + sentComment = '[图片]'; + console.log('评论图片已添加'); + } catch (error) { + console.error('图片评论失败:', error); + // 只提示一次,避免每篇笔记都弹 + if (!this.imageCommentWarned) { + this.imageCommentWarned = true; + this.showToast('⚠️ 图片评论发送失败:' + error.message + ';建议切换「自定义文字」或「AI」模式'); + } + return; // 跳过本篇 + } } else { sentComment = await this.inputComment(); console.log('评论已输入'); @@ -1880,7 +1891,7 @@ class XHSNoteSaver { fileInput = await this.revealCommentFileInput(); } if (!fileInput) { - throw new Error('未找到评论图片上传入口(小红书页面可能已改版)'); + throw new Error('网页版评论框没有图片上传入口(小红书仅手机App支持图片评论)'); } // 注入文件并触发 change 事件 diff --git a/manifest.json b/manifest.json index 22d0756..9ea56eb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "小红书自动评论助手", - "version": "1.7.6", + "version": "1.7.7", "description": "右侧侧边栏常驻的自动评论助手,支持试用/卡密授权、固定池/自定义文字/图片/AI评论", "permissions": [ "storage", diff --git a/sidepanel.html b/sidepanel.html index df52b85..2964424 100644 --- a/sidepanel.html +++ b/sidepanel.html @@ -211,7 +211,7 @@ diff --git a/sidepanel.js b/sidepanel.js index 1b4ad7b..41f8592 100644 --- a/sidepanel.js +++ b/sidepanel.js @@ -1155,7 +1155,7 @@ class AutoCommentManager { hint.textContent = '⚠ 自定义文字模式还没有文字内容,请在下方填写并保存'; hint.classList.add('warn'); } else if (current === 'image' && imageCount === 0) { - hint.textContent = '⚠ 图片回复模式还没有上传图片,请在下方选择图片'; + hint.textContent = '⚠ 小红书网页版评论不支持发图片(仅手机App支持),此模式大概率发不出,建议用「自定义文字」或「AI」'; hint.classList.add('warn'); } else if (current === 'custom' && hasKey) { hint.textContent = '⚠ 当前是固定评论池,下方模型配置不会生效;要按笔记生成请点「AI 按笔记生成」'; @@ -1165,7 +1165,8 @@ class AutoCommentManager { } else if (current === 'text') { hint.textContent = `✓ 每篇笔记发送一条自定义文字(共 ${textCount} 条循环)`; } else if (current === 'image') { - hint.textContent = `✓ 每篇笔记发送一张图片(共 ${imageCount} 张循环)`; + hint.textContent = `⚠ 已上传 ${imageCount} 张,但小红书网页版评论不支持发图片(仅手机App支持),大概率发送失败,建议改用「自定义文字」或「AI」`; + hint.classList.add('warn'); } else { hint.textContent = '固定评论池 = 循环发预设短评;下方模型配置暂不生效'; }