Commit Graph

264 Commits

Author SHA1 Message Date
augushong
9aacfab11d fix(phone-image): 修复XSS注入、正则兼容性、render锁稳定性和缓存清理
T1: XSS修复 - PHP模板注入改用json_encode,poster URL转义处理
T2: fontSize NaN修复 - parseInt统一处理,lookbehind正则替换为兼容方案
T3: render锁稳定性 - insertPageBreak/removePageBreak添加15次重试上限,
     fontsReady添加catch处理,_pending递归添加错误捕获
T4: 缓存清理 - init()清空缓存,render()超过3倍blocks数自动清理
2026-05-07 21:29:45 +08:00
augushong
e657e37dd4 perf(phone-image): 缓存截图数据避免重复html2canvas调用,添加render并发锁
- 新增 convertedBlockCache + simpleHash 缓存已转换的表格/代码块图片
- 首次render截图后缓存,后续调字号/切尺寸/插分页直接复用
- render() 添加 _locked/_pending 并发锁,防止多次渲染同时执行
- insertPageBreak/removePageBreak 加锁检查,渲染中延迟重试
2026-05-07 20:30:34 +08:00
augushong
404f4d8a22 refactor(phone-image): 在中间栏截图转换表格和代码块为图片,确保渲染一致性
- 新增 convertFlowBlocksToImages():在 #content-flow 中用 html2canvas 截图转换 table/pre 块为 img
- 修改 render() 管线:renderContentFlow -> convertFlowBlocksToImages -> measureBlockHeights
- 删除旧的 convertCodeBlocks() 和 convertTables()(doCapturePages 中不再需要)
- 添加 parseHtmlToBlocks 的 case 'pre' 分支
- splitOversizedBlock 添加 pre 不拆分规则
- isPureImagePage 跳过 data-converted=true 的图片避免误判
2026-05-03 23:32:41 +08:00
augushong
2233b2b71a fix(phone-image): 修复代码块/表格转换DOM索引失效bug,增加重新生成按钮和中间栏表格样式
- convertCodeBlocks/convertTables: 改为每次重新find().first()替代缓存索引
- 修复replaceWith后jQuery集合中后续元素DOM引用失效的问题
- 新增'重新生成'按钮,强制重新渲染缩略图
- 新增中间栏content-flow-block表格CSS样式
2026-05-03 22:56:34 +08:00
augushong
168f0a9adc fix(phone-image): remove output-manage button and fix history date display 2026-05-03 22:06:57 +08:00
augushong
1d3d935899 fix: 修复phone-image截图循环idx参数传递bug导致无限循环
capturePageViaHtml2Canvas函数将idx作为参数传入,.then回调中idx++只修改参数副本而非闭包变量,
导致runCaptureLoop中idx永远为0,截图循环无限重复处理第一页。
改为传递onDone回调函数,在回调中正确修改闭包变量idx。
2026-05-03 21:49:53 +08:00
augushong
06d9d5d139 fix(post-list): redirect layout button directly to editor page 2026-05-03 21:23:11 +08:00
augushong
5f5dc180c9 feat(phone-image): add history popup with load config support 2026-05-03 21:22:00 +08:00
augushong
c51cd8beb5 feat(phone-image): add save button and state management 2026-05-03 21:16:00 +08:00
augushong
a65025add9 feat(post-output): add save-only and load-history endpoints 2026-05-03 21:08:58 +08:00
augushong
f08957ad7e fix(phone-image): replace estimate-based pagination with DOM-measured heights 2026-05-03 21:04:23 +08:00
augushong
2bbde158b9 fix(Post): 修复排版内容副本读取时配置字段类型转换问题
确保从 postOutput 配置中读取 content_html 时,配置字段已转换为数组,避免因对象类型导致的错误。
2026-05-03 19:49:38 +08:00
augushong
2ba48fd58d feat(phone-image): pure image page optimization - use original image instead of screenshot 2026-05-03 10:23:39 +08:00
augushong
6cff21d50f feat(phone-image): table-to-image conversion with beautified CSS styles 2026-05-03 10:17:34 +08:00
augushong
d35172e14e fix(phone-image): fix blank thumbnail preview - visibility and wrapper 2026-05-03 10:07:13 +08:00
augushong
9dc37283a3 feat(phone-image): code blocks converted to images via prismjs + html2canvas 2026-05-03 09:19:31 +08:00
augushong
f3f209c403 refactor(phone-image): thumbnail alignment toggles and saveImages uses staging 2026-05-03 09:14:20 +08:00
augushong
8aeda4c518 refactor(phone-image): JS engine renders thumbnails via html2canvas 2026-05-03 09:08:15 +08:00
augushong
3cc024409f refactor(phone-image): CSS and HTML for thumbnail preview container 2026-05-03 09:00:32 +08:00
augushong
c179ed27f1 fix(admin): 统一jpe/jpeg扩展名为jpg
检测到文件MIME类型对应的扩展名为jpe或jpeg时,统一转换为更常见的jpg格式,确保后续文件路径处理的一致性。
2026-05-02 22:10:42 +08:00
augushong
45efbc24f6 fix(Post): 修正点击数缓存处理逻辑
- 使用 getOrigin 方法替代直接访问 data 数组,提高健壮性
- 修复缓存值为空字符串时的类型转换问题
- 在 setHitsAttr 中预加载 hits_title 属性确保缓存存在
- 统一使用整型返回值,避免类型不一致
2026-05-02 21:24:04 +08:00
augushong
9dce9854c8 fix(phone-image): T7 integration fixes
Fix 3 bugs found during Playwright integration testing:

1. Template syntax: {|json_encode|default='{}'} -> PHP native (curly braces parsed as TP6 tags)

2. jQuery event namespace mismatch: off('click.phoneImage') -> off('click') to match on('click')

3. Migration executed on server

All 6 Playwright test scenarios passed: layout, content flow, preview, alignment, font size, toolbar buttons
2026-05-02 09:54:59 +08:00
augushong
03e9a30242 fix(phone-image): saveImages always sends current content_html
Ensure postData.content_html (modified by break insertions) is sent to server, not the original hidden div content
2026-05-02 09:31:07 +08:00
augushong
57187a9d1d refactor(phone-image): three-column layout with content flow and paginated preview
T6: Rewrite phone_image.html to three-column layout (toolbar 220px | content flow 540px | paginated preview flex:1)

- Remove: template buttons, font selector, AI section, preview button, page navigation

- Add: content-flow area, paginated-preview area, export long image button

- Update: postData with coverText, layoutContentHtml, savedConfig restore

- Debounced doRender (300ms), auto-render on page load
2026-05-02 09:30:20 +08:00
augushong
b53ba68f68 feat(phone-image): add content flow, interactive breaks, per-page alignment and long image export
T9: renderContentFlow(), insertPageBreak(), removePageBreak(), renderAlignmentToggles(), exportLongImage()

- Content flow renders blocks to #content-flow with interactive break-inserters

- Page break markers have delete buttons

- Per-page alignment toggle buttons on each content page

- Long image export hides interactive elements before html2canvas capture

- Event delegation with proper unbind/rebind to avoid duplicates
2026-05-02 09:24:31 +08:00
augushong
bcd00e32ea refactor(phone-image): Wave 2 - form, controller, JS engine, API updates
T3: Add cover_text textarea to post edit form

T4: Update Post controller - content copy + cover_text passing

T5: Refactor JS engine - remove old APIs, add forced breaks, page numbers, per-page alignment

T8: Add cover_text to API default_fields, apidoc (4 places), AGENTS.md
2026-05-02 09:16:05 +08:00
augushong
2aa60f87ed feat(phone-image): add cover_text migration and rewrite CSS to xiaohongshu classic style
T1: Add cover_text text field to post table for phone image layout cover text

T2: Rewrite phone-image-templates.css - remove tpl-magazine/tpl-mixed, merge tpl-minimal into base styles, add content-flow/break-inserter/page-break-marker/page-alignment-toggle styles
2026-05-02 09:06:47 +08:00
augushong
0e3a442ddd fix(API): 修复文章发布时 publish_time 自动填充逻辑
统一处理 publish_time 参数,空字符串按未传处理。在创建和更新文章时,当文章状态为发布且未提供 publish_time 时,自动填充当前时间。同时修复更新文章时,从草稿首次发布且原 publish_time 为 0 时自动填充时间的逻辑。
2026-05-01 20:57:20 +08:00
augushong
a09f7397cd fix: 将文章默认类型从'1'更改为'3'
当创建文章未指定类型时,系统原默认设置为'1',现根据业务需求调整为'3'以匹配新的文章分类标准。
2026-05-01 20:37:38 +08:00
augushong
0d1e142a26 chore: 移除不再使用的手机预览图片文件
清理项目中已废弃的PNG图片资源,以减少仓库体积并避免混淆。
2026-05-01 16:33:45 +08:00
augushong
34fe255829 feat(phone-image): 增加翻页预览与无封面图排版样式
- 为手机截图生成器添加翻页功能,支持在生成前预览各页内容
- 增加无封面图时的排版样式,使用装饰线条和居中布局
- 改进图片处理逻辑,清除内联样式并展平嵌套包装元素
- 修复 models.dev 同步接口,支持 GET 请求获取缓存数据
- 优化网络请求,添加直连失败后的本地代理重试机制
2026-05-01 16:31:26 +08:00
augushong
eab8cee8a8 fix(api): 修复getData(id)新建对象时抛异常,改用isset安全检查 2026-05-01 16:19:38 +08:00
augushong
2f5846225e fix(api): 修复创建文章500错误和更新文章数据覆盖问题 2026-05-01 16:17:00 +08:00
augushong
83a2bd48a2 feat(post): 新增手机图片排版与AI智能排版功能
- 新增手机图片排版功能,支持小红书/抖音尺寸输出
- 新增AI智能排版顾问,支持内容分析与优化推荐
- 新增AI供应商管理,支持多渠道配置与同步
- 新增文章输出管理页面,支持图片预览与批量下载
- 新增字体文件与排版样式配置
2026-05-01 12:23:17 +08:00
augushong
b4558b55fb feat(admin): 为登录功能添加验证码开关配置
- 在环境变量中引入 `captcha_login` 配置项,用于控制登录时是否需要验证码
- 根据配置动态显示或隐藏登录页面的验证码输入框
- 后端登录验证逻辑根据配置决定是否校验验证码
2026-05-01 10:49:22 +08:00
augushong
d1300b8796 fix: 修复上传文件处理和粘贴图片URL替换的问题
- 修复 UploadFiles 中 $request->file() 可能返回 null 导致类型错误的问题,确保 $files 始终为数组
- 优化粘贴外部图片 URL 处理逻辑,使用正则匹配提取所有外部 URL 后统一延迟处理,避免替换错误
- 增加 URL 转义处理,防止特殊字符在正则替换时出错
2026-05-01 09:11:43 +08:00
augushong
aed4b285d8 feat: 添加Vditor编辑器支持并扩展文件上传功能
- 新增Vditor编辑器静态资源文件,包括图片、字体和样式文件
- 在文件上传控制器中添加vditorSave方法,支持Vditor编辑器文件上传
- 在文章创建页面添加编辑器类型选择(富文本/Markdown)
- 更新.gitignore文件,排除Playwright和QA截图目录
- 扩展UploadFiles类以支持Vditor编辑器的文件上传格式
2026-04-30 22:27:03 +08:00
augushong
cbf9b21b96 feat(api): 增强文章API功能并更新文档
- 为文章创建和更新接口添加 `publish_time` 字段支持
- 升级 Markdown 解析器以支持表格扩展
- 增加数据库字段默认值设置,避免严格模式错误
- 禁止客户端设置 `create_time` 和 `update_time` 字段
- 更新 API 文档以反映上述更改
- 将临时文件和工具目录添加到 .gitignore
2026-04-30 12:17:50 +08:00
augushong
6f332467df feat(content-type): add content_type field, markdown auto-conversion, and API doc updates
- Add content_type column to ul_post via migration
- Install league/commonmark for markdown->HTML conversion
- Add Post model accessors/setters for content_type and content
- Update API Articles controller save/update with content_type support
- Update API docs with content_type parameter and markdown example

Closes content-type-support plan
2026-04-29 20:46:44 +08:00
augushong
0e8944bc7f docs: 为 category-api 和 apikey-article-api 添加项目笔记文件
- 添加 category-api 的 problems、decisions、learnings、issues 文档
- 添加 apikey-article-api 的 issues、decisions、learnings 文档
- 包含架构决策、问题记录和学习总结
2026-04-28 21:03:15 +08:00
augushong
bb08dee91d feat(api): 新增分类查询接口(列表+详情,支持树形结构) 2026-04-28 21:01:27 +08:00
augushong
004f4454f4 fix: 移除未使用的 import,修正 PSR-12 空行 2026-04-27 00:45:26 +08:00
augushong
dc116a1c77 feat(api): add article/attachment API endpoints, admin management, and API docs
- Articles API: list/detail/create/update/delete with source-based permission control
- Attachments API: upload/list/delete with source-based permission control
- ApiKeyInfo API: query current key permissions
- Admin ApiKey management: generate/regenerate/toggle/permission settings with layui UI
- Frontend API documentation page with complete interface reference
2026-04-27 00:38:57 +08:00
augushong
ac4d34884e feat(api-key): add api_key table, source fields, model and auth middleware 2026-04-27 00:07:18 +08:00
augushong
351808bf07 docs: 添加项目知识库文档
添加 AGENTS.md 和 app/AGENTS.md 两个知识库文档,分别记录项目整体架构和应用模块详情。文档包含项目结构、代码映射、开发约定和反模式说明,便于新开发者快速了解系统。
2026-04-26 22:31:20 +08:00
augushong
df6b22d35c feat: 导出时增加默认的代码类型 2025-11-09 13:07:27 +08:00
augushong
c17b69fcdf feat: 增加平台信息跳转 2025-10-05 14:28:46 +08:00
augushong
9a0bd9b2b0 feat: 优化三方平台加载 2025-10-04 10:51:10 +08:00
augushong
bfe89fcdef feat: 优化行内样式生成 2025-10-04 10:37:03 +08:00
augushong
23f6db5b48 feat: 导出增加分类显示 2025-06-27 12:52:47 +08:00