From 121ec1c81a9e02069fa7755f21096eda5a2234f8 Mon Sep 17 00:00:00 2001 From: yihong1120 Date: Wed, 24 Jan 2024 00:06:34 +0800 Subject: [PATCH] Change the strcuture of code to fetch input json file --- lib/screens/accounts/account_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/accounts/account_page.dart b/lib/screens/accounts/account_page.dart index f03111b..abcfa47 100644 --- a/lib/screens/accounts/account_page.dart +++ b/lib/screens/accounts/account_page.dart @@ -43,8 +43,8 @@ class AccountPageState extends State { if (userInfo != null) { setState(() { - _username = userInfo['username'] ?? 'N/A'; // 根据你的API调整字段名 - _email = userInfo['email'] ?? 'N/A'; // 根据你的API调整字段名 + _username = userInfo['user']['username'] ?? 'N/A'; // 根据你的API调整字段名 + _email = userInfo['user']['email'] ?? 'N/A'; // 根据你的API调整字段名 }); } else { // 处理userInfo为空的情况,例如通过显示错误消息