Files
wechat_crawler/配置API密钥.bat

49 lines
1.6 KiB
Batchfile
Raw Permalink Normal View History

@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