fix(health): 客户试用前全局审计修复 — P0 权限旁路 + API 路径 + 事件注册
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

P0 阻塞修复:
- 修复 PrivateRoute 权限旁路: p.startsWith('auth.') 匹配不到任何权限码,
  改为基于实际权限码的路由级检查 (user.manage/role.manage/organization.manage)
- 修复 deviceReadings API 路径: /patients/{id}/device-readings/daily 改为
  /vital-signs/daily?patient_id=, 消除 404

P1 重要修复:
- 补全事件注册表: 新增 auth(11) + config(8) + workflow(4) + plugin(2) = 25 条
- article_article_tag 联表新增 tenant_id + deleted_at + 审计列 (迁移 107)
- vital_signs_hourly 新增 deleted_at 支持软删除过滤 (迁移 108)
- 6 个页面添加权限守卫 (AlertDashboard/AlertRuleList/DeviceManage/
  AiAnalysisList/AiUsageDashboard)
- DialysisModule 声明 auth 依赖
This commit is contained in:
iven
2026-05-04 11:02:25 +08:00
parent cde3a863a2
commit 30a578ee00
16 changed files with 260 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
# HMS 事件注册表
> 生成日期: 2026-04-30 | 审计后状态
> 生成日期: 2026-05-04 | 全系统审计后更新
## 概述
@@ -116,16 +116,69 @@
| `message.sent` | erp-message | erp-health event.rs (日志) | FIRE-AND-FORGET |
| `message.send` (内部命令) | erp-health event.rs | erp-message (消息发送触发) | OK |
### 用户与认证erp-auth
| 事件类型 | 发布者 | 消费者 | 状态 |
|---------|--------|--------|------|
| `user.login` | auth_service.rs:161 | — | FIRE-AND-FORGET |
| `user.created` | user_service.rs:94 | — | FIRE-AND-FORGET |
| `user.deleted` | user_service.rs:284 | erp-workflow (终止用户流程实例) | OK |
| `role.created` | role_service.rs:129 | — | FIRE-AND-FORGET |
| `role.deleted` | role_service.rs:250 | — | FIRE-AND-FORGET |
| `organization.created` | org_service.rs:123 | — | FIRE-AND-FORGET |
| `organization.deleted` | org_service.rs:310 | — | FIRE-AND-FORGET |
| `department.created` | dept_service.rs:141 | — | FIRE-AND-FORGET |
| `department.deleted` | dept_service.rs:350 | — | FIRE-AND-FORGET |
| `position.created` | position_service.rs:109 | — | FIRE-AND-FORGET |
| `position.deleted` | position_service.rs:240 | — | FIRE-AND-FORGET |
### 系统配置erp-config
| 事件类型 | 发布者 | 消费者 | 状态 |
|---------|--------|--------|------|
| `setting.updated` | setting_service.rs:117 | — | FIRE-AND-FORGET |
| `setting.created` | setting_service.rs:163 | — | FIRE-AND-FORGET |
| `dictionary.created` | dictionary_service.rs:121 | — | FIRE-AND-FORGET |
| `dictionary.deleted` | dictionary_service.rs:240 | — | FIRE-AND-FORGET |
| `menu.created` | menu_service.rs:148 | — | FIRE-AND-FORGET |
| `menu.deleted` | menu_service.rs:284 | — | FIRE-AND-FORGET |
| `numbering_rule.created` | numbering_service.rs:142 | — | FIRE-AND-FORGET |
| `numbering_rule.deleted` | numbering_service.rs:276 | — | FIRE-AND-FORGET |
### 工作流引擎erp-workflow
| 事件类型 | 发布者 | 消费者 | 状态 |
|---------|--------|--------|------|
| `process_definition.created` | definition_service.rs:103 | — | FIRE-AND-FORGET |
| `process_definition.published` | definition_service.rs:266 | — | FIRE-AND-FORGET |
| `process_definition.deprecated` | definition_service.rs:325 | — | FIRE-AND-FORGET |
| `process_instance.started` | instance_service.rs:126 | — | FIRE-AND-FORGET |
| `task.completed` | task_service.rs:231 | erp-health (匹配 `workflow.task.completed`) | OK |
| `task.timeout` | module.rs:115 | — | FIRE-AND-FORGET |
### 插件系统erp-plugin
| 事件类型 | 发布者 | 消费者 | 状态 |
|---------|--------|--------|------|
| `plugin.trigger.{manifest_id}.{trigger_name}` | data_service.rs:79 | notification.rs (管理通知) | OK |
| `plugin.config.updated` | service.rs:477 | — | FIRE-AND-FORGET |
| *(WASM 动态事件)* | engine.rs:817 | 动态订阅manifest 声明) | OK |
---
## 统计
| 指标 | 数量 |
|------|------|
| 事件类型总数 | 28 |
| OK完整链路 | 20 |
| FIRE-AND-FORGET仅日志 | 6 |
| 事件类型总数 | 51 |
| OK完整链路 | 24 |
| FIRE-AND-FORGET仅日志/审计 | 25 |
| PENDING未实现 | 2 |
| erp-health 域事件 | 26 |
| erp-auth 域事件 | 11 |
| erp-config 域事件 | 8 |
| erp-workflow 域事件 | 6 |
| erp-plugin 域事件 | 2+(含动态) |
---