## 安全增强 - 添加 CSRF 防护机制(Double Submit Cookie 模式) - 增强密码强度验证(8字符+两种字符类型) - 添加 Session 密钥安全检查 - 修复 .htaccess 文件上传漏洞 - 统一使用 getSafeErrorMessage() 保护敏感错误信息 - 增强数据库原型污染防护 - 添加被封禁用户分享访问检查 ## 功能修复 - 修复模态框点击外部关闭功能 - 修复 share.html 未定义方法调用 - 修复 verify.html 和 reset-password.html API 路径 - 修复数据库 SFTP->OSS 迁移逻辑 - 修复 OSS 未配置时的错误提示 - 添加文件夹名称长度限制 - 添加文件列表 API 路径验证 ## UI/UX 改进 - 添加 6 个按钮加载状态(登录/注册/修改密码等) - 将 15+ 处 alert() 替换为 Toast 通知 - 添加防重复提交机制(创建文件夹/分享) - 优化 loadUserProfile 防抖调用 ## 代码质量 - 消除 formatFileSize 重复定义 - 集中模块导入到文件顶部 - 添加 JSDoc 注释 - 创建路由拆分示例 (routes/) ## 测试套件 - 添加 boundary-tests.js (60 用例) - 添加 network-concurrent-tests.js (33 用例) - 添加 state-consistency-tests.js (38 用例) - 添加 test_share.js 和 test_admin.js ## 文档和配置 - 新增 INSTALL_GUIDE.md 手动部署指南 - 新增 VERSION.txt 版本历史 - 完善 .env.example 配置说明 - 新增 docker-compose.yml - 完善 nginx.conf.example Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
91 lines
2.6 KiB
JavaScript
91 lines
2.6 KiB
JavaScript
/**
|
|
* 路由模块索引
|
|
*
|
|
* 本项目的路由目前主要定义在 server.js 中。
|
|
* 此目录用于未来路由拆分的模块化重构。
|
|
*
|
|
* 建议的路由模块拆分方案:
|
|
*
|
|
* 1. routes/health.js - 健康检查和公共配置
|
|
* - GET /api/health
|
|
* - GET /api/config
|
|
* - GET /api/public/theme
|
|
*
|
|
* 2. routes/auth.js - 认证相关
|
|
* - POST /api/login
|
|
* - POST /api/register
|
|
* - POST /api/logout
|
|
* - POST /api/refresh-token
|
|
* - POST /api/password/forgot
|
|
* - POST /api/password/reset
|
|
* - GET /api/verify-email
|
|
* - POST /api/resend-verification
|
|
* - GET /api/captcha
|
|
* - GET /api/csrf-token
|
|
*
|
|
* 3. routes/user.js - 用户相关
|
|
* - GET /api/user/profile
|
|
* - GET /api/user/theme
|
|
* - POST /api/user/theme
|
|
* - POST /api/user/update-oss
|
|
* - POST /api/user/test-oss
|
|
* - GET /api/user/oss-usage
|
|
* - POST /api/user/change-password
|
|
* - POST /api/user/update-username
|
|
* - POST /api/user/switch-storage
|
|
*
|
|
* 4. routes/files.js - 文件操作
|
|
* - GET /api/files
|
|
* - POST /api/files/rename
|
|
* - POST /api/files/mkdir
|
|
* - POST /api/files/folder-info
|
|
* - POST /api/files/delete
|
|
* - GET /api/files/upload-signature
|
|
* - POST /api/files/upload-complete
|
|
* - GET /api/files/download-url
|
|
* - GET /api/files/download
|
|
* - POST /api/upload
|
|
*
|
|
* 5. routes/share.js - 分享功能
|
|
* - POST /api/share/create
|
|
* - GET /api/share/my
|
|
* - DELETE /api/share/:id
|
|
* - GET /api/share/:code/theme
|
|
* - POST /api/share/:code/verify
|
|
* - POST /api/share/:code/list
|
|
* - POST /api/share/:code/download
|
|
* - GET /api/share/:code/download-url
|
|
* - GET /api/share/:code/download-file
|
|
*
|
|
* 6. routes/admin.js - 管理员功能
|
|
* - GET /api/admin/settings
|
|
* - POST /api/admin/settings
|
|
* - POST /api/admin/settings/test-smtp
|
|
* - GET /api/admin/health-check
|
|
* - GET /api/admin/storage-stats
|
|
* - GET /api/admin/users
|
|
* - GET /api/admin/logs
|
|
* - GET /api/admin/logs/stats
|
|
* - POST /api/admin/logs/cleanup
|
|
* - POST /api/admin/users/:id/ban
|
|
* - DELETE /api/admin/users/:id
|
|
* - POST /api/admin/users/:id/storage-permission
|
|
* - GET /api/admin/users/:id/files
|
|
* - GET /api/admin/shares
|
|
* - DELETE /api/admin/shares/:id
|
|
* - GET /api/admin/check-upload-tool
|
|
* - POST /api/admin/upload-tool
|
|
*
|
|
* 使用示例(在 server.js 中):
|
|
* ```javascript
|
|
* const healthRoutes = require('./routes/health');
|
|
* app.use('/api', healthRoutes);
|
|
* ```
|
|
*/
|
|
|
|
const healthRoutes = require('./health');
|
|
|
|
module.exports = {
|
|
healthRoutes
|
|
};
|