修复:两个bug(在学校电脑上改的)

This commit is contained in:
2025-09-25 15:10:47 +08:00
parent 097c9d929f
commit a8ef9ecf5f
2 changed files with 13 additions and 5 deletions

View File

@@ -276,6 +276,7 @@ class AppDetailWindow(QMainWindow):
# 通过开发者ID查询开发者名称 # 通过开发者ID查询开发者名称
developer_id = app_data.get('developer_id', '') developer_id = app_data.get('developer_id', '')
result2 = self.api_client.make_request('getdeveloperinfo', {'id': developer_id})
developer_name = "未知开发者" developer_name = "未知开发者"
if developer_id and developer_id != "0": if developer_id and developer_id != "0":
@@ -283,7 +284,7 @@ class AppDetailWindow(QMainWindow):
try: try:
developer_info = self.api_client.make_request('getdeveloperinfo', {'id': developer_id}) developer_info = self.api_client.make_request('getdeveloperinfo', {'id': developer_id})
if isinstance(developer_info, dict) and 'success' in developer_info and developer_info['success']: if isinstance(developer_info, dict) and 'success' in developer_info and developer_info['success']:
developer_name = developer_info['data'].get('name', '未知开发者') developer_name = result2['data'].get('username')
else: else:
# 如果API调用失败尝试从本地数据获取 # 如果API调用失败尝试从本地数据获取
if 'developer_name' in app_data and app_data['developer_name']: if 'developer_name' in app_data and app_data['developer_name']:
@@ -366,12 +367,12 @@ class AppDetailWindow(QMainWindow):
stats_card.setStyleSheet(""" stats_card.setStyleSheet("""
#StatsCard { #StatsCard {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white; /* color: white; */
border-radius: 12px; border-radius: 12px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
} }
#StatsCard QLabel { #StatsCard QLabel {
color: white; /* color: white; */
} }
""") """)
@@ -453,9 +454,16 @@ class AppDetailWindow(QMainWindow):
info_grid_layout.setColumnStretch(1, 1) info_grid_layout.setColumnStretch(1, 1)
# 添加基本信息字段,对开发者信息进行特殊处理 # 添加基本信息字段,对开发者信息进行特殊处理
developer_name = app_data.get("developer_name", "") print(app_data)
developer_id = app_data.get('developer_id')
print(developer_id)
result2 = self.api_client.make_request('getdeveloperinfo', {'id': developer_id})
result2 = result2["data"]
print(result2)
developer_name = result2.get("username")
print(developer_name)
if not developer_name: if not developer_name:
developer_name = app_data.get("developer", "--") developer_name = result2.get("username")
info_items = [ info_items = [
("应用ID", app_data.get("id", "--")), ("应用ID", app_data.get("id", "--")),