2.2 KiB
2.2 KiB
Change: 按实际接口更新管理端通知中心
Why
通知中心已有前端链路,但当前类型和页面仍兼容旧字段,例如 content、read_status、旧的未读摘要结构和可路由目标结构。后端接口文档已更新为实际可用的管理端 API,需要按真实响应字段和受控目标协议修正通知铃铛、抽屉、通知中心及状态同步逻辑。
What Changes
- 按实际接口更新通知项字段:
body、is_read、read_at、ref_type、ref_id、ref_key。 - 按实际接口更新通知列表筛选参数:使用
is_readboolean,支持category、type、severity、page、page_size。 - 接入真实未读数响应
{ count, display_count },顶部徽标直接展示后端display_count。 - 接入真实未读分类汇总
{ approval, expiry, sync, system, total },抽屉最近通知通过通知列表接口获取,最多展示10条。 - 全部已读调用
PUT /api/admin/notifications/read-all,支持可选category请求体。 - 受控目标按
target_type、target_id、target_key建立前端白名单映射,不接受或执行任意 URL/路由字段。 - 通知中心展示正文
body、读取状态is_read、首次已读时间read_at,并支持余额、审批、临期、同步/系统分类。 - 本变更只覆盖管理端,明确不接入 C 端
/api/c/v1/notifications。
Impact
- Affected specs:
notification-center
- Affected code:
src/types/api/notification.tssrc/api/modules/notification.tssrc/store/modules/notification.tssrc/components/core/layouts/art-header-bar/index.vuesrc/components/core/layouts/art-notification/index.vuesrc/views/notifications/index.vuesrc/utils/business/notificationNavigation.ts
- API contracts:
GET /api/admin/notificationsPUT /api/admin/notifications/{id}/readPUT /api/admin/notifications/read-allGET /api/admin/notifications/unread-countGET /api/admin/notifications/unread-summaryGET /api/admin/notifications/{id}/target
- Out of scope:
- C 端
/api/c/v1/notifications接口和页面 - 创建、编辑或删除通知
- WebSocket、浏览器推送和新的实时推送机制
- C 端