diff --git a/admin/dashboard/server.py b/admin/dashboard/server.py index 4f40972..0a566ad 100644 --- a/admin/dashboard/server.py +++ b/admin/dashboard/server.py @@ -182,25 +182,16 @@ class DashboardServer: # 获取用户详细信息 user_info = self.wcf.get_user_info() - self.logger.info(f"获取用户信息:: {user_info}") - # 获取头像 - avatar_path = None - try: - avatar_path = self.wcf.get_avatar(wx_id) - except Exception as e: - self.logger.warning(f"获取用户头像失败: {e}") + self.logger.info(f"获取用户信息:{user_info}") return { "success": True, "data": { - "wx_id": wx_id, - "nickname": user_info.get("nickname", "未知用户"), - "avatar": avatar_path, - "signature": user_info.get("signature", ""), - "gender": user_info.get("gender", 0), - "country": user_info.get("country", ""), - "province": user_info.get("province", ""), - "city": user_info.get("city", "") + "wx_id": user_info.get("wxid", wx_id), + "nickname": user_info.get("name", "未知用户"), + "avatar": "logo.png", # 使用默认LOGO + "mobile": user_info.get("mobile", ""), + "home": user_info.get("home", "") } } except Exception as e: diff --git a/admin/dashboard/templates/index.html b/admin/dashboard/templates/index.html index c44313a..25057f6 100644 --- a/admin/dashboard/templates/index.html +++ b/admin/dashboard/templates/index.html @@ -17,7 +17,7 @@
- +
{% raw %}{{ currentUser.data.nickname }}{% endraw %}