feat(admin): 添加系统健康检测功能
新增管理员健康检测面板,可检测以下配置项: - 安全配置:JWT密钥、CORS、HTTPS、管理员账号、登录防爆破 - 服务状态:SMTP邮件、数据库连接、存储目录 - 运行配置:反向代理支持、Node环境 修改文件: - backend/auth.js: 新增 isJwtSecretSecure() 函数 - backend/server.js: 新增 /api/admin/health-check API - frontend/app.js: 新增健康检测数据和方法 - frontend/app.html: 新增健康检测UI界面 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -132,9 +132,15 @@ function adminMiddleware(req, res, next) {
|
||||
next();
|
||||
}
|
||||
|
||||
// 检查JWT密钥是否安全
|
||||
function isJwtSecretSecure() {
|
||||
return !DEFAULT_SECRETS.includes(JWT_SECRET) && JWT_SECRET.length >= 32;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
JWT_SECRET,
|
||||
generateToken,
|
||||
authMiddleware,
|
||||
adminMiddleware
|
||||
adminMiddleware,
|
||||
isJwtSecretSecure
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user