
lanterngamescnandClaude Opus 4.8
187e73a549
M3(T-M2-04/T-M3-13): LocalUploadServer 截图上传分享链路落地
补「H5 主动 POST 截图上传分享」链路,对齐原工程 OkHttpPhotoServer + savehandler:
- LocalUploadServer 从骨架实现为真实本机 HTTP server(@ohos.net.socket TCPSocketServer):
127.0.0.1:8099 起逐端口重试 listen;手解极简 HTTP/1.1(\r\n\r\n 分隔 + Content-Length
累积读全 body);仅 POST /testurl,body 取 base64(form name=/raw 兼容)+type → emit
PHOTO_UPLOAD → 回 200;非 /testurl 回 404;16MB 上限;异常 log 不崩溃。
baseUrl 反映实际端口。注:TCPSocketServer 无显式 close,stop 用 off('connect')+释放引用
- common ShareEvents.PHOTO_UPLOAD + PhotoUploadPayload
- ShareProvider:订阅 PHOTO_UPLOAD(仅激活槽处理,避免双实例重复分享)→ 落盘 → 微信图片
分享(type=="1"好友/其他朋友圈)→ sharesuccess;onDestroy 退订;抽 wechatImageByFriend/
wechatSceneByFriend 供面板截图与 POST 上传两条链路共用
真机验证项:H5 真实 POST body 格式、127.0.0.1 端口可达、微信开放平台注册
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 08:19:21 +08:00
..
2026-06-26 08:19:21 +08:00
2026-06-25 06:58:29 +08:00
2026-06-25 06:58:29 +08:00
2026-06-25 06:58:29 +08:00
2026-06-25 06:58:29 +08:00
2026-06-26 08:19:21 +08:00
2026-06-25 06:58:29 +08:00
2026-06-25 06:58:29 +08:00
2026-06-25 06:58:29 +08:00