Skip to content

Conversation

@FinleyGe
Copy link
Collaborator

Summary

  • 实现了微信公众号Markdown上传工具
  • 优化了输入参数解析逻辑,支持多种类型转换
  • 修复了图片上传逻辑,正确调用微信API进行图片上传

主要改进

1. 参数解析优化

  • 添加了 parseStringOrArray 函数,支持字符串和字符串数组的自动转换
  • 实现了JSON编码数组的解析功能
  • 增强了类型安全性,避免参数解析异常

2. 图片上传逻辑修复

  • 使用 downloadImageFromUrl 统一处理图片下载
  • 调用微信API (handleUploadImage) 上传文章内图片为临时素材
  • 调用微信API (handleAddMaterial) 上传封面图为永久素材
  • 自动替换原始图片URL为微信CDN链接

3. 功能特性

  • 支持单篇和批量Markdown文章上传
  • 自动处理HTML清理和内联样式添加
  • 完善的错误处理和日志记录
  • 支持自定义标题、作者、摘要等信息

Test plan

  • 测试单篇Markdown上传功能
  • 测试批量Markdown上传功能
  • 验证参数解析的健壮性
  • 确认图片上传到微信服务器成功
  • 检查生成的草稿箱内容格式正确

🤖 Generated with Claude Code
via Happy

@github-actions
Copy link

Build Successful - Preview Images for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin-pr:4a115f852c909062b2ad3290cfc383e9b7f35ef5

Changed packages:
wechatOfficialAccount

@FinleyGe FinleyGe force-pushed the feat/tool/wechat-official-account branch from 4a115f8 to 0afde65 Compare November 28, 2025 10:18
…sfully

- Fix conflicts in lib/s3/const.ts (S3 URL construction)
- Fix conflicts in lib/worker/loadTool.ts (version generation)
- Fix conflicts in modules/tool/parseMod.ts (module parsing with temp support)
- Preserve version generation functionality for tools and toolsets
- Add missing dependencies: marked, cheerio
- Verify WeChat Official Account tool builds successfully

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@pull-request-size pull-request-size bot added size/S and removed size/L labels Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant