This commit is contained in:
2025-11-25 11:41:56 +08:00
parent af24b473cd
commit c8228cc68f
3 changed files with 67 additions and 24 deletions

View File

@@ -1,9 +1,5 @@
from setuptools import setup, find_packages
import sys
import platform
import uuid
import hashlib
import requests
package_name = 'hertz_studio_django_xxx'
@@ -17,23 +13,15 @@ def read_requirements():
with open("requirements.txt", "r", encoding="utf-8") as f:
return [line.strip() for line in f if line.strip() and not line.startswith("#")]
# 机器码验证请求
def request_verify_machine_code(package_name, machine_code):
"""请求验证机器码"""
url = "http://activate.hzsystems.cn/api/activate_machine"
data = {"package_name": package_name, "machine_code": machine_code}
try:
response = requests.post(url, json=data, timeout=10)
return response.json()
except requests.RequestException as e:
print(f"机器码验证请求失败: {e}")
return None
# 机器码验证功能
def verify_machine_license():
"""验证机器码"""
import platform
import uuid
import hashlib
print("\n" + "="*60)
print("欢迎使用 Hertz System xxx!")
print("欢迎使用 Hertz System Xxx!")
print("="*60)
print("本软件需要机器码验证才能安装。")
print("请联系作者获取安装权限hertz studio(563161210@qq.com)")
@@ -47,8 +35,18 @@ def verify_machine_license():
print("请将此机器码发送给作者进行注册。")
# 请求验证机器码
response = request_verify_machine_code(package_name, machine_id)
if response.get('success') == True:
import requests
url = "http://activate.hzsystems.cn/api/activate_machine"
data = {"package_name": package_name, "machine_code": machine_id}
try:
response = requests.post(url, json=data, timeout=10)
result = response.json()
success = result.get('success') == True
except requests.RequestException as e:
print(f"机器码验证请求失败: {e}")
success = False
if success:
print("=" * 60)
print("机器码验证成功!")
print("=" * 60)
@@ -104,4 +102,4 @@ setup(
"Source": "http://hzgit.hzsystems.cn/hertz_studio_django/hertz_studio_django_xxx",
"Documentation": "http://hzgit.hzsystems.cn/hertz_studio_django/hertz_studio_django_xxx#readme",
},
)
)