此版本包含: 1. 新增位置消息发送与展示功能 2. 完善多语言本地化文案 3. 新增安卓端管理空间Activity与图标背景 4. 优化摇一摇开关逻辑与深度链接配置 5. 新增信息流平台过滤与A/B测试后台功能 6. 更新签名配置与构建脚本 7. 修复若干已知问题与代码优化
73 lines
2.4 KiB
Python
73 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
|
"""上传A/B测试相关文件到服务器"""
|
|
import paramiko
|
|
import os
|
|
|
|
HOST = '123.207.67.197'
|
|
USER = 'root'
|
|
PASS = '520Kiss123'
|
|
|
|
LOCAL_BASE = r'e:\project\flutter\f\xianyan\docs\toolsapi\application'
|
|
REMOTE_BASE = '/www/wwwroot/tools.wktyl.com/application/'
|
|
JS_LOCAL = r'e:\project\flutter\f\xianyan\docs\toolsapi\public\assets\js\backend'
|
|
JS_REMOTE = '/www/wwwroot/tools.wktyl.com/public/assets/js/backend/'
|
|
|
|
FILES = [
|
|
('admin/controller/AbTest.php', 'admin/controller/AbTest.php'),
|
|
('admin/view/ab_test/index.html', 'admin/view/ab_test/index.html'),
|
|
('admin/view/ab_test/add.html', 'admin/view/ab_test/add.html'),
|
|
('admin/view/ab_test/edit.html', 'admin/view/ab_test/edit.html'),
|
|
('admin/lang/zh-cn/ab_test.php', 'admin/lang/zh-cn/ab_test.php'),
|
|
('api/controller/Feed.php', 'api/controller/Feed.php'),
|
|
]
|
|
|
|
JS_FILES = [
|
|
('ab_test.js', 'ab_test.js'),
|
|
('feed_weight.js', 'feed_weight.js'),
|
|
]
|
|
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect(HOST, port=22, username=USER, password=PASS, timeout=15)
|
|
sftp = ssh.open_sftp()
|
|
|
|
success = 0
|
|
for local_name, remote_name in FILES:
|
|
local_path = os.path.join(LOCAL_BASE, local_name)
|
|
remote_path = REMOTE_BASE + remote_name
|
|
if not os.path.exists(local_path):
|
|
print(f" SKIP: {local_name} (not found)")
|
|
continue
|
|
# 创建远程目录
|
|
remote_dir = os.path.dirname(remote_path).replace('\\', '/')
|
|
try:
|
|
sftp.stat(remote_dir)
|
|
except:
|
|
ssh.exec_command(f'mkdir -p {remote_dir}')
|
|
import time; time.sleep(0.5)
|
|
try:
|
|
sftp.put(local_path, remote_path)
|
|
print(f" OK: {local_name}")
|
|
success += 1
|
|
except Exception as e:
|
|
print(f" FAIL: {local_name}: {e}")
|
|
|
|
for local_name, remote_name in JS_FILES:
|
|
local_path = os.path.join(JS_LOCAL, local_name)
|
|
remote_path = JS_REMOTE + remote_name
|
|
if not os.path.exists(local_path):
|
|
print(f" SKIP: {local_name} (not found)")
|
|
continue
|
|
try:
|
|
sftp.put(local_path, remote_path)
|
|
print(f" OK: JS/{local_name}")
|
|
success += 1
|
|
except Exception as e:
|
|
print(f" FAIL: JS/{local_name}: {e}")
|
|
|
|
# 清除缓存
|
|
ssh.exec_command('rm -rf /www/wwwroot/tools.wktyl.com/runtime/cache/* /www/wwwroot/tools.wktyl.com/runtime/temp/*')
|
|
sftp.close()
|
|
ssh.close()
|
|
print(f"\nDone: {success}/{len(FILES)+len(JS_FILES)}")
|