多余日志清理,修复部分作品无法创建文件夹的问题

This commit is contained in:
2025-08-24 15:58:22 +08:00
parent 8d19acf8f3
commit a35e82731d
10 changed files with 410 additions and 354 deletions
+6 -3
View File
@@ -22,7 +22,7 @@ const proxyConfig = require('./config');
// 自定义日志中间件
function customLogger(req, res, next) {
// 过滤掉静态资源请求
// 过滤掉静态资源请求和图片代理请求
const isStaticResource = req.path.startsWith('/assets/') ||
req.path.startsWith('/downloads/') ||
req.path.includes('.js') ||
@@ -38,8 +38,11 @@ function customLogger(req, res, next) {
req.path.includes('.ttf') ||
req.path.includes('.eot');
// 只记录API请求和重要请求
if (!isStaticResource) {
// 过滤掉图片代理请求
const isImageProxy = req.path === '/api/proxy/image';
// 只记录API请求和重要请求,排除静态资源和图片代理
if (!isStaticResource && !isImageProxy) {
const start = Date.now();
// 原始响应结束方法