AlertNotifyChannel.Config 原先以真值返回。钉钉/飞书/企微的 webhook URL 与 Bark 的 device key 本身就是凭据,泄露即可直接向对应群或设备推送消息,而列表接口对 具备 recharge:manage 的商户成员可见。 - 新增 service.MaskAlertChannel(s):在 HTTP 响应层脱敏,只保留密钥末 4 位。 webhook 保留域名与路径以便辨认是哪一台机器人(钉钉/企微的 token 在查询串, 飞书的 uuid 在路径末段),Server 属主机地址不遮蔽 - UpdateAlertChannel 识别回传的脱敏占位值并沿用库中真实密钥,使「只改名称/开关」 不会被掩码覆盖;填写新值则正常替换 - 脱敏刻意不放在 service 层:CheckLowBalanceAndNotify 复用 ListAlertChannels 的结果真正去发消息,在那一层脱敏会直接打断告警发送 - 前端表单补充说明文案 验证:新增 6 组测试,覆盖脱敏规则、三种机器人 URL 形态、脱敏结果仍能通过校验、 掩码回传不覆盖真实密钥,以及「service 层必须返回真值」这条关键边界。
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
See the Oxlint rules documentation for the full list of rules and categories.