mirror of
https://github.com/LifeArchiveProject/WeChatDataAnalysis.git
synced 2026-06-18 15:54:08 +08:00
feat(detection): 添加当前登录账号检测功能
This commit is contained in:
@@ -277,8 +277,12 @@ async def detect_wechat_detailed(data_root_path: Optional[str] = None):
|
||||
"""详细检测微信安装信息,包括版本、路径、消息目录等。"""
|
||||
logger.info("开始执行微信检测")
|
||||
try:
|
||||
from .wechat_detection import detect_wechat_installation
|
||||
from .wechat_detection import detect_wechat_installation, detect_current_logged_in_account
|
||||
info = detect_wechat_installation(data_root_path=data_root_path)
|
||||
|
||||
# 检测当前登录账号
|
||||
current_account_info = detect_current_logged_in_account(data_root_path)
|
||||
info['current_account'] = current_account_info
|
||||
|
||||
# 添加一些统计信息
|
||||
stats = {
|
||||
@@ -306,6 +310,29 @@ async def detect_wechat_detailed(data_root_path: Optional[str] = None):
|
||||
}
|
||||
|
||||
|
||||
@app.get("/api/current-account", summary="检测当前登录账号")
|
||||
async def detect_current_account(data_root_path: Optional[str] = None):
|
||||
"""检测当前登录的微信账号"""
|
||||
logger.info("开始检测当前登录账号")
|
||||
try:
|
||||
from .wechat_detection import detect_current_logged_in_account
|
||||
result = detect_current_logged_in_account(data_root_path)
|
||||
|
||||
logger.info(f"当前账号检测完成: {result.get('message', '无结果')}")
|
||||
|
||||
return {
|
||||
'status': 'success',
|
||||
'data': result
|
||||
}
|
||||
except Exception as e:
|
||||
logger.error(f"当前账号检测失败: {str(e)}")
|
||||
return {
|
||||
'status': 'error',
|
||||
'error': str(e),
|
||||
'data': None
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user