Files
xianyan/docs/toolsapi/scripts/verify_feature_flag.py
Developer f91be94e9c refactor: 完成项目架构重构,统一模块导入路径
- 清理大量废弃的 barrel 导出文件,移除冗余的中间导出层
- 修复所有相对路径导入错误,统一调整为扁平化模块引用
- 更新多平台 pubspec 版本号与依赖库版本
- 补充后端功能问题管理后台与脚本工具
- 调整部分页面的快捷方式文案适配新功能
- 更新部分翻译覆盖率与API文档
2026-06-12 08:53:57 +08:00

40 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""通过SSH验证Feature Flag数据和JS文件"""
import paramiko
HOST = '123.207.67.197'
PORT = 22
USER = 'root'
PASS = '520Kiss123'
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(HOST, port=PORT, username=USER, password=PASS, timeout=15)
# 1. 读取数据库配置文件
cmd1 = r"php -r \"require '/www/wwwroot/tools.wktyl.com/thinkphp/base.php'; echo json_encode(\\think\\Config::get('database'));\" 2>&1"
stdin, stdout, stderr = ssh.exec_command(cmd1, timeout=15)
db_config = stdout.read().decode('utf-8', errors='replace')
print('DB Config:', db_config[:300])
# 2. 用API验证数据
cmd2 = "curl -s 'https://tools.wktyl.com/api/feature_flag/list' 2>&1 | head -500"
stdin, stdout, stderr = ssh.exec_command(cmd2, timeout=15)
api_result = stdout.read().decode('utf-8', errors='replace')
print('\nAPI list 结果:')
print(api_result[:500])
# 3. 验证JS文件列定义
cmd3 = "grep -n 'field:' /www/wwwroot/tools.wktyl.com/public/assets/js/backend/feature_flag.js 2>&1"
stdin, stdout, stderr = ssh.exec_command(cmd3, timeout=15)
js_fields = stdout.read().decode('utf-8', errors='replace')
print('\nJS文件列定义:')
print(js_fields)
# 4. 清缓存
cmd4 = "rm -rf /www/wwwroot/tools.wktyl.com/runtime/cache/* 2>&1 && echo 'Cache cleared'"
stdin, stdout, stderr = ssh.exec_command(cmd4, timeout=15)
print(stdout.read().decode('utf-8', errors='replace'))
ssh.close()