Files
wechat_crawler/配置API密钥.bat
李顺东 e28e91f1d5 chore: Add batch scripts for build, deployment, and configuration
- Remove *.bat from .gitignore to track build and utility scripts
- Add build.bat for automated PyInstaller packaging with dependency checks
- Add run_gui.bat for launching the GUI application with error handling
- Add 启动工具.bat interactive menu for accessing all project tools and operations
- Add 修复并重新打包.bat comprehensive build script with COM component fixes
- Add 配置API密钥.bat utility for configuring API keys in config.json
- Enable version control of batch scripts for easier distribution and maintenance
2026-02-11 16:32:01 +08:00

49 lines
1.6 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
title 配置API密钥
color 0B
echo ╔════════════════════════════════════════╗
echo ║ 配置百炼API密钥工具 ║
echo ╚════════════════════════════════════════╝
echo.
echo 此工具用于在打包前配置API密钥
echo API密钥将被写入config.json文件
echo.
echo ════════════════════════════════════════
echo.
set /p api_key=请输入您的百炼API密钥:
if "%api_key%"=="" (
echo.
echo [错误] API密钥不能为空
pause
exit /b 1
)
echo.
echo 正在更新配置文件...
python -c "import json; config = json.load(open('config.json', 'r', encoding='utf-8')); config['api_key'] = '%api_key%'; json.dump(config, open('config.json', 'w', encoding='utf-8'), ensure_ascii=False, indent=2)"
if errorlevel 1 (
echo [错误] 配置失败
pause
exit /b 1
)
echo [成功] API密钥已配置
echo.
echo ════════════════════════════════════════
echo 下一步:
echo ════════════════════════════════════════
echo 1. 配置目标群组编辑config.json
echo 2. 运行打包脚本(修复并重新打包.bat
echo 3. 测试打包后的exe
echo.
echo 提示API密钥已保存在config.json中
echo 打包后的exe将使用此密钥
echo.
pause