chore(ops): /api/health 增加 build 与 features 能力清单,便于部署自检
- 线上小程序请求新接口 404 时,可先 curl /api/health 确认线上构建版本与已包含能力 - features 覆盖:用户令牌/后台口令闸门/安全头/限流/5xx脱敏/令牌吊销/通知中心/服务包自助/优惠券/大神搜索 - 回归 96 套件/669 用例全绿
这个提交包含在:
@@ -196,7 +196,25 @@ app.get('/', (_req: Request, res: Response) => {
|
||||
});
|
||||
|
||||
app.get('/api/health', (_req: Request, res: Response) => {
|
||||
res.json({ status: 'healthy', database: 'connected', uptime: process.uptime() });
|
||||
// features 用于部署自检:小程序请求新接口 404 时,可先 curl 本接口确认线上构建是否已更新
|
||||
res.json({
|
||||
status: 'healthy',
|
||||
database: 'connected',
|
||||
uptime: process.uptime(),
|
||||
build: '2026-10-19',
|
||||
features: {
|
||||
userToken: true,
|
||||
adminPasswordGate: true,
|
||||
securityHeaders: true,
|
||||
rateLimit: true,
|
||||
errorSanitize: true,
|
||||
adminTokenRevoke: true,
|
||||
notifications: true,
|
||||
expertServicesSelfManage: true,
|
||||
coupons: true,
|
||||
companionSearch: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// 统一校验用户是否处于封禁状态
|
||||
|
||||
在新工单中引用
屏蔽一个用户