iven
|
d44c6167b1
|
fix: E2E 测试发现的 10 项 BUG 修复 — 全栈验证通过
P0 修复:
- 侧边栏路由不稳定: Content 区域添加 key={currentPath} 强制重渲染
- 轮播图缩略图不显示: BannerManage 导入 resolveMediaUrl + 反斜杠转正斜杠
- 超长名称导致 500: patient_handler 添加 name.len() > 255 校验
- 迁移 m20260515_000146: version 乐观锁 version+1 修复
P1 修复:
- 排班路由被冻结: routeConfig.ts 移除 /health/schedules 的 frozen 标记
- 轮播图 Switch 切换无效: 切换前先 GET 最新 version 避免乐观锁冲突
- thumbnail_url 反斜杠: media_service 存储时统一 replace('\', '/')
P2 修复:
- 预约类型 follow_up 未映射: APPOINTMENT_TYPE_MAP 补充 '随访'
- 日期选择器未汉化: DatePicker.RangePicker 添加中文 placeholder
- 轮播图 title 必填校验: banner_handler 添加空标题拒绝
- 文章分类重名: article_category_service 添加同名检查
|
2026-05-15 21:13:49 +08:00 |
|
iven
|
8763e10d6e
|
fix: 全局权限优化 — 7 项问题修复
1. 菜单权限修复:补充 10 个菜单的 permission 字段 + 修复 menu_service
回退逻辑(admin 直接跳过过滤,非 admin 无关联则不显示)+ 收紧前端过滤
2. 管理员重置密码:新增 POST /users/{id}/reset-password 端点 + 前端按钮
3. 告警处理人姓名:AlertResponse 添加 acknowledged_by_name 字段
4. Tab 权限过滤:PatientDetail 6 个 Tab 按权限过滤 + 状态字段 Tooltip
5. 消息中心 UI:添加 Popconfirm/AuthButton,移除 inline isDark
|
2026-05-15 19:00:48 +08:00 |
|
iven
|
4ca9027cd6
|
fix: 联合调试问题修复 — 预约错误提示 + request 错误提取 + copilot 解包
- ISSUE-APPOINTMENT-001: 后端 DoctorNotFound 改为 Validation 错误(400)
+ 改善错误消息"所选医生暂无医护档案,请联系管理员"
+ 小程序预约创建 catch 传递实际错误消息(不再硬编码"预约失败")
+ 小程序 request.ts 提取后端 message 字段作为用户提示
- copilot API: listInsights/listRules/getPatientRisk 补齐 data.data 解包
- 移除 error.rs 重复的 AppointmentNotFound 分支
|
2026-05-15 15:25:26 +08:00 |
|
iven
|
057d9b5896
|
fix(health): 修复咨询统计返回零值 BUG + 清理 secure-storage 过时注释
BUG-CONSULTATION-001: safe_aggregate 包装导致 compute_avg_response_time
SQL JOIN 错误时整个统计函数返回零值默认。修复方式:
- handler 层移除 safe_aggregate 改为直接 .await?
- service 层对 compute_avg_response_time 独立错误处理(warn + None)
同时清理 secure-storage.ts 中关于 crypto-js 的过时注释(已移除)。
|
2026-05-15 15:05:53 +08:00 |
|
iven
|
8f353946e1
|
fix(mp): T40 UI 审计修复 — 28 项设计系统合规 + 安全加固 + 讨论记录
T40 UI 审计修复(60 页面全覆盖):
- 新增 $acc-d/$wrn-d 渐变中间色变量,修复首页轮播渐变硬编码
- 替换 8 处裸 white 为 $white 设计变量(5 个 SCSS 文件)
- 修复 7 处触摸目标 40/44px → 48px(健康/消息/咨询/预约/首页)
- 3 页面新增 Loading 状态(体征录入/个人中心/就诊人添加)
- statusTag 移除硬编码布局值,改用 SCSS mixin 控制
- 医生端 14 页面架构 Hook 层补充(useThrottledDidShow 替换 useEffect)
- 移除 action-inbox 未使用 import
安全 P0 修复:
- JWT 中间件加固:token 类型校验 + 过期预检 + 类型别名简化
- 速率限制增强:滑动窗口 + 暴力破解防护
- analytics handler 错误处理完善
文档:
- T40 审计报告(24 PASS / 36 PASS_WITH_ISSUES / 0 NEEDS_WORK)
- 5 份 DevTools/性能审计讨论记录
- wiki 症状导航 + 小程序章节更新
|
2026-05-14 23:12:54 +08:00 |
|
iven
|
212c08b7ae
|
feat(health,ai): 后端服务优化 + 媒体文件处理
- erp-health: article/banner/consultation/media 服务层优化
- erp-ai: analysis/insight/prompt 服务增强
- erp-auth: auth/role/token 服务改进
- erp-workflow: executor 执行引擎修复
- erp-plugin: 服务层改进
- 新增媒体上传文件样例
|
2026-05-13 23:28:57 +08:00 |
|
iven
|
02082ccc61
|
feat(ci,ai): P2-1 权限注册表 + P2-2 AI utoipa 注解全覆盖
P2-1 权限注册表单一真相源:
- 新增 permissions.yaml: 131 个权限码 × 8 模块,含冻结标记
- 新增 scripts/gen-permissions.js: 生成器脚本
--sql 输出 seed SQL, --frontend 输出 routeConfig 片段,
--validate 验证一致性(131/131 = 0 mismatches)
P2-2 AI 模块 utoipa 注解:
- 为 30 个 handler 函数添加 #[utoipa::path] 注解
(mod.rs 18 + insight 3 + risk 1 + rule 4 + suggestion 4)
- 为 6 个 DTO struct 添加 ToSchema/IntoParams derive
(AnalyzeBody, CreatePromptBody, CreateRuleBody, UpdateRuleBody,
ApproveBody, ExecuteBody, DialysisLabInput, ListAnalysisQuery,
ListPromptsQuery)
- AI handler utoipa 覆盖率: 0/5 → 5/5 (100%)
|
2026-05-13 17:45:45 +08:00 |
|
iven
|
c681049c82
|
fix(db,ci): 补全 26 个缺失权限码 seed 注册 + 检查脚本增强
- 新增迁移 000144 全实体乐观锁 version 字段强制化
- 新增迁移 000145 注册 26 个后端已声明但 seed 缺失的权限码
(ai.analysis/prompt/suggestion/usage/provider, copilot.insights/risk/rules,
health.ble-gateways/critical-alerts/devices/family-proxy/shifts 等)
- check-permissions.sh: 增加 module.rs PermissionDescriptor 提取,
支持两段式权限码 (plugin.admin/tenant.manage)
- CI 检查结果: Check 1 PASS, Check 2 PASS, 0 个不一致
|
2026-05-13 14:30:27 +08:00 |
|
iven
|
d6676abecf
|
fix(ai): Copilot 审计修复 — C-1/H-1/H-2/H-3/H-4/H-5/L-2
- L-2: value_to_f64 对 Null 返回 NaN(防止误触发规则)
- C-1: load_patient_data 空数据时跳过写入快照
- H-1: 每日刷新定时器添加初始延迟
- H-2: copilot_consumer 传内层 content
- H-3: 前端 hooks/Alert 修复分页响应解析
- H-4: risk_handler 动态选择 AI provider
- H-5: 新增 DELETE /copilot/rules/{id} 软删除路由
|
2026-05-13 00:21:27 +08:00 |
|
iven
|
a48ad6ed33
|
feat(ai): 告警洞察生成逻辑 + 事件消费者增强
- engine.rs 新增 generate_anomaly_insights(过滤 info 级别)
- copilot_consumer 在风险评分后自动生成 warning/critical 告警洞察
|
2026-05-12 22:34:11 +08:00 |
|
iven
|
a87425e551
|
feat(db): 8 条 Copilot 趋势/复合类告警规则种子数据
趋势类(4): 收缩压快速上升、肌酐连续上升、体重连续上升、血压趋势上升
复合类(4): eGFR+血钾双重危急、透析间期+血压、失约+依从性、Kt/V+血压
|
2026-05-12 22:30:16 +08:00 |
|
iven
|
ba0a4f4d2e
|
feat(ai): 每日风险快照批量刷新定时任务
- risk_service 新增 refresh_all_patients 方法
- module on_startup 启动每日刷新后台任务
|
2026-05-12 22:14:08 +08:00 |
|
iven
|
a999ee0036
|
feat(ai): LLM 补充风险分析 + 降级策略
- scoring.rs 新增 llm_supplement 函数(调用 AI provider 生成补充洞察)
- risk_service 新增 compute_risk_with_llm 方法(LLM 失败静默降级)
- risk_handler 改用 compute_risk_with_llm
|
2026-05-12 22:10:05 +08:00 |
|
iven
|
44dcfbd5cb
|
feat(ai): Copilot 事件消费者(订阅 health 事件触发风险评分刷新)
|
2026-05-12 22:00:47 +08:00 |
|
iven
|
95db4fe9ff
|
feat(db): 15 条 Copilot 内置规则种子数据
覆盖 5 大类: 体征异常(4) + 化验异常(4) + 依从性(2) + 透析质量(3) + 综合(2)
系统级规则(tenant_id=nil)适用于所有机构
|
2026-05-12 12:18:40 +08:00 |
|
iven
|
57f33dd726
|
feat(ai): Copilot 评分引擎 + Handler + 路由 + 权限码
- scoring.rs: 混合评分 (calculate_risk) + RiskScore/MatchedRule 结构
- engine.rs: CopilotEngine 协调规则评估和评分
- risk_service.rs: 风险计算 + UPSERT 快照 + 规则加载
- insight_service.rs: 洞察 CRUD + 过期清理
- 3 个 Handler: insight/risk/rule,7 个 API 端点
- 5 个权限码: copilot.insights.list/manage, copilot.risk.view, copilot.rules.list/manage
- AiState 扩展 risk_service + insight_service
|
2026-05-12 12:14:16 +08:00 |
|
iven
|
fe983ba4ae
|
feat(ai): Copilot 基因化 Phase 0 Task 1-4 — 迁移 + Entity + 规则引擎
- 4 表迁移: copilot_rules, copilot_insights, copilot_risk_snapshots, copilot_chat_logs
- 4 个 SeaORM Entity 对应新表
- JSONLogic 规则引擎 (evaluate + evaluate_rules) + 5 个单元测试
|
2026-05-12 11:57:09 +08:00 |
|
iven
|
0a8ff4bbe7
|
docs(health): OpenAPI 注解 — diagnosis + device_reading + vital_signs_daily
为 3 个 handler 文件共 8 个函数添加 #[utoipa::path] 注解。
P1-5 批次 2/N。
|
2026-05-11 13:07:57 +08:00 |
|
iven
|
ac8d300dc0
|
docs(health): OpenAPI 注解 — device_handler + consent_handler
为 device_handler (2 函数) 和 consent_handler (3 函数) 添加
#[utoipa::path] 注解。P1-5 批次 1/N。
|
2026-05-11 13:05:11 +08:00 |
|
iven
|
d0cb45f457
|
refactor(health): 拆分 module.rs 路由注册为 13 个子模块
protected_routes (800+ 行) 按业务域拆分为 routes/ 目录下 13 个文件:
patient / health_data / follow_up / appointment / consultation /
article / points / stats / alert / device / media / care / admin。
module.rs 从 1595 行降至 798 行,路由注册逻辑更清晰。
|
2026-05-11 12:59:56 +08:00 |
|
iven
|
533a2b6a8e
|
feat(server): BLE 网关独立限流 — 每网关 60 req/60s
为 /health/gateway 路由添加 gateway_id 级别的速率限制,
网关认证(API Key)→ 限流检查 → handler 三层中间件。
Redis 不可达时同样遵循 fail_close 策略。
|
2026-05-11 10:24:22 +08:00 |
|
iven
|
0f67f1c21f
|
fix(server): 限流中间件 fail-close 安全加固
RateLimitConfig 添加 fail_close 字段(默认 true),Redis 不可达时
拒绝请求返回 503 而非静默放行。开发环境可通过
ERP__RATE_LIMIT__FAIL_CLOSE=false 回退旧行为。
|
2026-05-11 10:22:05 +08:00 |
|
iven
|
8c347a5de9
|
refactor(health): 拆分 event.rs(2871 行)为 13 个领域文件
将单体 event.rs 按业务域拆分为 event/ 模块目录:
- mod.rs (219 行): 31 事件常量 + 调度器 + 测试
- 12 个消费者文件: workflow/device/alert/patient/appointment/
follow_up/health_data/ai/consent/consultation/points/lab_report
每个消费者文件 50-215 行,独立可维护。
编译零错误,测试全部通过。
|
2026-05-11 10:09:10 +08:00 |
|
iven
|
129a7b175c
|
fix(health): 允许已发布文章重新提交审核 — published → pending_review
状态机新增 published → pending_review 转换,
已发布文章编辑后可直接提交审核,无需先撤回。
审核期间旧版本继续对外展示,审核通过后覆盖发布。
|
2026-05-11 09:49:56 +08:00 |
|
iven
|
e00ee69d28
|
fix(core,health): 文章内容 sanitize 保留安全 HTML 标签 + 血透测试文章种子
- 新增 sanitize_rich_html() 使用 ammonia 白名单保留安全 HTML 标签和内联样式
- 修复文章创建/更新时 content 被 strip_html_tags() 完全剥离的问题
- ammonia 4 不允许手动指定 <a> 的 rel 属性(自动管理),已从 tag_attrs 移除
- 新增 3 个 sanitize_rich_html 单元测试
- 新增 seed-dialysis-articles.mjs 种子脚本(4 篇血透相关富文本文章)
|
2026-05-11 03:13:43 +08:00 |
|
iven
|
4788e19a1d
|
fix(health,miniprogram): 轮播图图片改用相对路径 + wx.downloadFile 解决 HTTP 限制
问题:微信小程序 <image> 不支持 HTTP URL,签名 URL 与 upload 中间件不兼容。
修复:
1. 公开轮播图 API 返回相对路径(/uploads/...)而非签名 URL
2. 小程序用 wx.downloadFile 下载图片后使用本地临时路径
3. 移除 banner_handler 中不再需要的 base_url/Host header 逻辑
|
2026-05-10 20:14:43 +08:00 |
|
iven
|
a6ec8129c9
|
refactor(web,health): 消除硬编码路径 — 统一 resolveMediaUrl + 动态 base_url
1. 新增 resolveMediaUrl() 工具函数,统一处理 storage_path 前缀和 JWT token
2. MediaLibrary 和 MediaPicker 改用 resolveMediaUrl,消除重复逻辑
3. banner_handler 不再硬编码 localhost:3000,改为从 Host header 动态构建 base_url
|
2026-05-10 20:00:39 +08:00 |
|
iven
|
fca0b5a78f
|
feat(health): 新增公开文章列表端点 /public/articles 供小程序访客首页使用
访客首页文章列表调用 /health/articles 需要 JWT 认证导致 401。
新增 GET /public/articles?tenant_id=xxx 端点,强制只返回已发布文章,
无需认证。小程序访客首页改用此公开端点。
|
2026-05-10 19:14:31 +08:00 |
|
iven
|
edb4b6557d
|
fix(health): 修复媒体库和轮播图菜单不可见 — parent_id/permission/menu_roles 三重修复
种子迁移 m20260510_000137 存在三个问题导致菜单不显示:
1. parent_id 查找用了错误条件(path='/health'),改为 title='内容运营'
2. menu INSERT 缺少 permission 字段
3. 缺少 menu_roles 关联(admin/operator)
同时新增 BannerManage.tsx 前端页面
|
2026-05-10 19:07:20 +08:00 |
|
iven
|
7fcabd2e6b
|
fix(health): 修复迁移外键表名引用 + 公开轮播图签名 URL 路径拼接
|
2026-05-10 17:13:02 +08:00 |
|
iven
|
85bff6f267
|
feat(server): 配置签名 URL 密钥 — StorageConfig.secret_key
|
2026-05-10 15:39:11 +08:00 |
|
iven
|
1a459de4ad
|
feat(health): 注册媒体库和轮播图路由 + 权限码 + 公开端点
|
2026-05-10 15:35:47 +08:00 |
|
iven
|
3a672636c0
|
feat(health): 实现媒体库 handler (12 端点) + 轮播图 handler (6 端点)
媒体库 handler (media_handler.rs):
- 上传/列表/详情/更新/删除媒体文件 + 文件夹 CRUD + 移动 + 裁剪
轮播图 handler (banner_handler.rs):
- 管理端 5 端点(列表/创建/更新/删除/排序)
- 公开端点 1 个(小程序无需认证获取生效轮播图)
|
2026-05-10 15:32:09 +08:00 |
|
iven
|
a9bd850ce2
|
feat(health): 实现轮播图 service — CRUD + 排序 + 签名 URL
- list_banners: 列出轮播图,可选状态筛选,批量加载 media_item 避免 N+1
- create_banner: 创建轮播图,验证 media_item 存在且未删除
- update_banner: 更新轮播图,带乐观锁
- delete_banner: 软删除轮播图
- sort_banners: 批量更新排序
- list_public_banners: 公开端点,查询生效轮播图 + HMAC-SHA256 签名 URL
- generate_signed_url: 同步函数,生成签名 URL token
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-10 15:15:11 +08:00 |
|
iven
|
601d977438
|
feat(health): 实现媒体库 service — CRUD + 缩略图 + 裁剪
|
2026-05-10 15:08:26 +08:00 |
|
iven
|
603a986281
|
feat(health): 新增 media_folder/media_item/banner 实体 + image/hmac/sha2 依赖
|
2026-05-10 14:19:55 +08:00 |
|
iven
|
11101ac204
|
feat(auth): 微信登录自动分配 patient 角色 + 创建患者档案
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
- 新增迁移 m20260510_000133:为所有租户创建 patient 角色并分配 19 个权限
- wechat_service: bind_phone 自动 assign_patient_role + ensure_patient_record
- find_or_create_user_by_phone 新用户自动获得 patient 角色和患者档案
- 小程序 auth store: bindPhone 抛出异常而非静默返回 false
- 小程序登录页: 捕获绑定错误并显示可操作的对话框
|
2026-05-10 09:57:45 +08:00 |
|
iven
|
8490344d69
|
fix(ai): AI 配额摘要端点 500 错误修复
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
get_usage_summary 中 get_tenant_config 和 get_monthly_token_usage 的
数据库错误直接传播为 AppError::Internal (500),当 ai_tenant_configs 表
为空或查询异常时导致整个端点不可用。
改为 unwrap_or 降级处理:config 缺失时使用默认配额,token 查询失败时归零,
确保端点始终返回有效数据而非 500。
|
2026-05-09 07:52:41 +08:00 |
|
iven
|
3e1413aebc
|
fix(auth): 修复 Token 刷新并发竞态条件
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
使用原子 CAS(UPDATE WHERE token_hash = ? AND revoked_at IS NULL)
替代先查后改的非原子操作,防止同一 refresh token 被并发使用两次。
新增 TokenService::validate_and_revoke_atomic 方法,将 JWT 解码、
哈希匹配和 token 撤销合并为单次数据库操作。
|
2026-05-09 01:53:28 +08:00 |
|
iven
|
28dafa9bea
|
fix: 多角色业务链路测试发现并修复 3 类问题
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
1. 角色权限修复(CRITICAL):
- operator 角色权限为空(迁移 name/code 不匹配 + 软删除冲突)
- doctor 角色权限被误清(API assign_permissions 失败导致全部软删除)
- nurse 缺 devices 权限 + doctor/nurse 缺 appointment 权限
- 新增 3 个迁移 000130-000132 修复所有角色权限
2. 趋势指标映射修复(HIGH):
- 前端 blood_pressure_systolic → systolic_bp_morning
- 前端 blood_sugar_fasting → blood_sugar
- 同步修复首页、健康页、趋势页的 indicator 参数
3. 咨询页错误处理优化(MEDIUM):
- 403/401 时显示空列表而非"加载失败"错误提示
|
2026-05-08 22:00:43 +08:00 |
|
iven
|
22b8ac7ac6
|
fix: 修复多角色找茬测试 V2 发现的 11 个问题
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 (CRITICAL):
- C1: 统计 API 全部改为 safe_aggregate 容错,防止单个子查询崩溃导致 500
- C2: Token 刷新增加用户身份验证,防止并发场景下身份切换
- C3: 患者端线下活动接口添加患者档案验证,防止 Doctor/HM 越权访问
P1 (HIGH):
- H1: 操作记录用 EntityName 组件解析用户名,不再显示截断 UUID
- H4: 告警标题添加中英文映射 (translateAlertTitle)
- H5: 告警面板补全 message import + 修复 hooks 顺序
- H8: 咨询消息发送按钮添加 AuthButton 权限控制
- H9: routeConfig 日常监测权限码改为 health.daily-monitoring.*
P2 (MEDIUM):
- M4: 咨询类型映射补全 online/phone/doctor/follow_up 中文标签
DTO: LabReportStatisticsResp, AppointmentStatisticsResp, VitalSignsReportRateResp 添加 Default derive
|
2026-05-08 12:42:41 +08:00 |
|
iven
|
c82f7bda1d
|
fix: 系统性预防角色测试高频问题(5 方案落地)
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 — 默认拒绝 + 强制守卫:
- 创建 routeConfig.ts 作为前端路由权限的单一真相源
- TypeScript 强制每个路由声明非空权限数组,不可能遗漏
- 自动生成 ROUTE_PERMISSIONS 和 FROZEN_ROUTES
- 修正 3 个前端权限码不匹配后端
P0 — CI 权限扫描:
- 新增 tools/check_permissions.py 校验脚本
- 发现并修复 tenant.manage 未注册问题
P1 — 聚合接口容错:
- erp-core 新增 safe_aggregate 工具函数
- 仪表盘统计 handler 重构
P1 — 状态机一致性自检:
- validation.rs 新增 3 个自检测试
fix: lint-staged eslint Windows 兼容性
|
2026-05-08 08:52:16 +08:00 |
|
iven
|
6d5a711d2c
|
fix: 修复测试发现的 7 个问题 + 全 workspace clippy 清零
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
功能修复:
1. 患者创建空名称验证:后端添加 name.trim().is_empty() 检查
2. 仪表盘统计容错:单个查询失败返回零值而非 500
3. FHIR 路由修复:从 /fhir 移到 /api/v1/fhir 保持一致
4. 冻结模块后端中间件:新增 frozen_module_middleware 拦截冻结路径
5. 积分端点权限码:health.health-data.list → health.points.list
6. 角色权限迁移:护士补充 devices.list,运营补充 points.list/manage
7. 测试结果文档:R01-R05 角色测试 + T00/T10 结果归档
Clippy 全 workspace 清零(14→0 errors):
- erp-core: 修复 empty doc line、collapsible if、redundant closure 等 9 处
- erp-health: 修复 too_many_arguments、unused var、unnecessary parens 等 58 处
- erp-ai: 修复 dead_code、unused import 等 11 处
- erp-plugin: 修复 too_many_arguments、wildcard pattern 等 11 处
- erp-server-migration: 修复 enum_variant_names 5 处
- erp-auth/config/workflow/message: 各 1-3 处
工程改进:
- lint-staged 配置迁移到 .lintstagedrc.js(函数式避免文件列表传给 clippy)
- cargo fmt 统一格式化
|
2026-05-07 23:43:14 +08:00 |
|
iven
|
786f57c151
|
fix: 修复角色测试发现的 5 个共性问题
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
- 修复前端路由守卫前缀碰撞(/health/articles 匹配 /health/article-categories)
- 补全 6 条缺失路由权限映射(appointments/follow-up-records/article-categories/article-tags/plugins/market)
- 修复 critical-alerts API 500(escalation_level 字段 INT2/i16 与 Entity i32 类型不匹配)
- 新增迁移 000128:告警状态修正 + 菜单权限码补全 + 非admin角色移除基础模块权限
|
2026-05-07 15:54:37 +08:00 |
|
iven
|
60dc4dba7a
|
fix(health): 修复 5 角色深度测试发现的权限越权和告警端点缺失
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
- auth: token_service 查询 role_permissions/user_roles 添加 deleted_at 过滤,
修复软删除的权限仍被加载到 JWT 的越权漏洞
- health: 新增 GET /health/alerts/{id} 告警详情端点(含 handler + service + 路由)
- web: AlertList 操作按钮增加 active 状态判断,修复按钮不显示
- migration: 新增 000127 清理 doctor 角色多余的 health-data.manage/ai.analysis.manage
|
2026-05-07 13:51:16 +08:00 |
|
iven
|
85a7dacd16
|
fix(health): 修复 5 角色深度测试发现的 8 个问题
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 修复:
- 告警状态机新增 active 合法状态 + 转换规则 (active→acknowledged/dismissed)
- 前端路由守卫改为默认拒绝,未注册路由返回 403
P1 修复:
- 侧边栏菜单根据用户权限码过滤,非 admin 隐藏无权限菜单项
- Critical-alerts handler 增加详细错误日志 + div_ceil 安全防护
- 仪表盘统计 API 调用使用 silent 模式避免 500 触发全局 toast
P2 修复:
- 随访类型映射新增 visit → 上门 (前后端同步)
- 随访 fallback 选项新增 visit 类型
排除的假 BUG (代码已正确):
- 患者性别/血型: MCP fill() 不兼容 Select 组件,正常交互正确
- 随访筛选/对话框关闭: 代码逻辑验证正确
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-07 08:24:12 +08:00 |
|
iven
|
1613e3cfe9
|
fix(health): 修复 5 角色测试发现的 4 个共性问题
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
- 权限路由守卫:静默重定向改为显示 403 页面,使用 useLocation 替代
window.location.hash,补全缺失路由权限条目
- 随访状态筛选:usePaginatedData hook 添加 filters 变化监听自动刷新
- 告警操作:后端 acknowledge/dismiss/resolve 改返回 AlertResponse
(含 patient_name),前端增加 active 状态兼容和错误反馈
- 咨询患者名:后端 create/get/close_session 增加 patient_name 和
doctor_name enrichment,前端 EntityName 空字符串处理
|
2026-05-07 07:23:41 +08:00 |
|
iven
|
43f0ba7057
|
fix(web): 修复角色测试发现的权限守卫、API 500、权限配置问题
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
1. CRITICAL: 前端路由权限守卫 — routePermissions 从 3 条扩展到 31 条,
覆盖全部 /health/* 路由;匹配逻辑从宽松模块级前缀改为精确权限码匹配
2. HIGH: health-data API 500 — jsonb_array_elements() 添加 CASE WHEN 类型守卫,
防止 items 字段为非数组 JSON 时崩溃
3. MEDIUM: Doctor 补充 ai.prompt.list、ai.usage.list、follow-up-templates 权限
4. Operator 清理 AI 分析、统计报表菜单关联
5. 更新 5 角色测试计划文档
|
2026-05-06 22:29:54 +08:00 |
|
iven
|
570377a31f
|
feat(config): 角色权限控制菜单可见性 + 医疗业务角色
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
- 修复 menu_service 角色过滤 bug: ctx.roles 存的是角色 code 而非 UUID,
新增 resolve_role_ids() 方法通过 code 查找数据库中的角色 ID
- 创建 4 个医疗业务角色: 医生/护士/健康管理师/运营人员
- 重组菜单目录结构: 基础模块→工作台、业务模块→系统管理、健康管理→健康业务
- 菜单排序按功能域分组(患者医护/随访咨询/积分运营/内容运营/AI分析)
- 为各角色分配对应的菜单可见性和操作权限
|
2026-05-06 12:35:45 +08:00 |
|
iven
|
263bba264a
|
chore(db): 冻结推迟模块菜单迁移
|
2026-05-06 10:30:58 +08:00 |
|