From 16f60b4b77a56e2ade135459249af8d638e77df1 Mon Sep 17 00:00:00 2001 From: kjqwer <2990346238@qq.com> Date: Thu, 2 Oct 2025 08:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0debug=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/create-portable.js | 40 +++++++++++++++++++++++++++++++++----- start.bat | 32 +++++++++++++++--------------- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/scripts/create-portable.js b/scripts/create-portable.js index d02fae3..96e7e59 100644 --- a/scripts/create-portable.js +++ b/scripts/create-portable.js @@ -26,9 +26,27 @@ async function createPortable() { title Pixiv Manager +REM ======================================== +REM Proxy Configuration - Modify port according to your proxy software +REM Common ports: Clash=7890, V2Ray=10809, Shadowsocks=1080 +REM ======================================== set PROXY_PORT=7890 + +REM ======================================== +REM Server Port Configuration - Default 3000 +REM ======================================== set SERVER_PORT=3000 +REM ======================================== +REM Log Level Configuration - Options: ERROR, WARN, INFO, DEBUG, TRACE +REM ERROR: Show only error messages +REM WARN: Show warning and above level messages +REM INFO: Show general information and above level messages (default) +REM DEBUG: Show debug information and above level messages +REM TRACE: Show all level messages (most detailed) +REM ======================================== +set LOG_LEVEL=INFO + echo. echo ======================================== echo Pixiv Manager Starting... @@ -39,8 +57,8 @@ cd /d "%~dp0" echo Current proxy port: %PROXY_PORT% echo Current server port: %SERVER_PORT% -echo To change proxy port, edit PROXY_PORT=xxxx in this file -echo To change server port, edit SERVER_PORT=xxxx in this file +echo Log level: %LOG_LEVEL% +echo To modify settings, edit this file with notepad echo. echo Starting backend server... @@ -49,8 +67,12 @@ echo. echo Tip: Press Ctrl+C to stop server echo. -:: Start server and pass proxy port and server port -pixiv-manager.exe --proxy-port=%PROXY_PORT% --server-port=%SERVER_PORT% +REM Start server and pass proxy port, server port and log level +if "%PROXY_PORT%"=="" ( + pixiv-manager.exe --server-port=%SERVER_PORT% --log-level=%LOG_LEVEL% +) else ( + pixiv-manager.exe --proxy-port=%PROXY_PORT% --server-port=%SERVER_PORT% --log-level=%LOG_LEVEL% +) echo. echo Server stopped @@ -81,6 +103,14 @@ pause ### 服务器端口设置 修改(SERVER_PORT=xxxx)的端口号,默认为3000 +### 日志级别设置 +修改(LOG_LEVEL=xxxx)的日志级别,可选值: +- ERROR: 只显示错误信息 +- WARN: 显示警告及以上级别信息 +- INFO: 显示一般信息及以上级别信息(默认) +- DEBUG: 显示调试信息及以上级别信息 +- TRACE: 显示所有级别信息(最详细) + ## 注意事项 - 首次运行可能需要几秒钟启动时间 @@ -104,4 +134,4 @@ pause } } -createPortable(); \ No newline at end of file +createPortable(); \ No newline at end of file diff --git a/start.bat b/start.bat index c58f6cc..9a80e27 100644 --- a/start.bat +++ b/start.bat @@ -1,25 +1,25 @@ @echo off chcp 65001 >nul -:: ======================================== -:: 代理配置 - 请根据你的代理软件修改端口号 -:: 常见端口: Clash=7890, V2Ray=10809, Shadowsocks=1080 -:: ======================================== +REM ======================================== +REM 代理配置 - 请根据你的代理软件修改端口号 +REM 常见端口: Clash=7890, V2Ray=10809, Shadowsocks=1080 +REM ======================================== set PROXY_PORT= -:: ======================================== -:: 服务器端口配置 - 默认3000 -:: ======================================== +REM ======================================== +REM 服务器端口配置 - 默认3000 +REM ======================================== set SERVER_PORT=3000 -:: ======================================== -:: 日志级别配置 - 可选值: ERROR, WARN, INFO, DEBUG, TRACE -:: ERROR: 只显示错误信息 -:: WARN: 显示警告及以上级别信息 -:: INFO: 显示一般信息及以上级别信息 (默认) -:: DEBUG: 显示调试信息及以上级别信息 -:: TRACE: 显示所有级别信息 (最详细) -:: ======================================== +REM ======================================== +REM 日志级别配置 - 可选值: ERROR, WARN, INFO, DEBUG, TRACE +REM ERROR: 只显示错误信息 +REM WARN: 显示警告及以上级别信息 +REM INFO: 显示一般信息及以上级别信息 (默认) +REM DEBUG: 显示调试信息及以上级别信息 +REM TRACE: 显示所有级别信息 (最详细) +REM ======================================== set LOG_LEVEL= echo. @@ -40,7 +40,7 @@ echo. echo 提示: 按 Ctrl+C 停止服务器 echo. -:: 启动服务器并传递代理端口、服务器端口和日志级别 +REM 启动服务器并传递代理端口、服务器端口和日志级别 if "%PROXY_PORT%"=="" ( node backend/start.js --server-port=%SERVER_PORT% --log-level=%LOG_LEVEL% ) else (