printServer/开发日志/2026-03-24_前端注册服务WS后端实现与回归.md
2026-03-29 13:26:23 +08:00

21 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

开发时间:2026-03-24
任务描述:实现前端网页通过 WebSocket 调用 setting.register 与 setting.unregister,并完成回归测试。
修改内容:
- 调整 services/setting.js,仅保留可供 WebSocket 直接调用的 info、unbind、register、unregister 方法,并补齐上下文绑定。
- register 改为通过 WebSocket 调用后写入 isService 状态,并尝试以 detached 方式拉起外部 node 进程,提升进程存活能力。
- 增强 core/wsServer.js 的错误回传信息,便于定位服务装载与 method 路由问题。
回归结果:
- 通过任务方式启动当前实例后,setting 服务成功装载。
- WebSocket 测试结果:
- setting.register 返回 success=true,result.ok=true。
- setting.unregister 返回 success=true,result.ok=true。
- 前端页面依赖的 method 路由方式已验证可用,调用链为 ws message -> method split -> services.setting.register/unregister。
涉及文件:
- services/setting.js
- core/wsServer.js
备注:
- 调试过程中发现共享终端存在历史输出串扰,最终采用 VS Code task 方式启动服务并完成回归。