Browse Source

app-我的-个人信息页面,更改用户信息时,接口请求失败新增失败提示;

dev
wurong 1 year ago
parent
commit
cce6b0e1c7
  1. 16
      lib/mine/user_info_page.dart

16
lib/mine/user_info_page.dart

@ -44,13 +44,13 @@ class _UserInfoPage extends State<UserInfoPage> {
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
print(value.getString('user')), print(value.getString('user')),
user = UserInfo.fromJson(jsonDecode(value.getString('user'))), user = UserInfo.fromJson(jsonDecode(value.getString('user'))),
mobile = user.phone, mobile = user?.phone ?? "",
modifyInfo["nickname"] = user.nickname, modifyInfo["nickname"] = user?.nickname ??"",
modifyInfo["signature"] = user.signature, modifyInfo["signature"] = user?.signature ?? "",
modifyInfo["birth"] = user.birth, modifyInfo["birth"] = user?.birth ?? "",
modifyInfo["headimg"] = user.headimg, modifyInfo["headimg"] = user?.headimg ?? "",
modifyInfo["sex"] = user.sex, modifyInfo["sex"] = user?.sex ?? "",
age = AppUtils.getAgeByString(user.birth), age = AppUtils.getAgeByString(user ?.birth ?? ""),
refresh(), refresh(),
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString('token')), context: context, token: value.getString('token')),
@ -478,6 +478,8 @@ class _UserInfoPage extends State<UserInfoPage> {
setState(() { setState(() {
SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center);
}); });
}else{
SmartDialog.showToast("用户信息修改失败 " + info.msg, alignment: Alignment.center);
} }
} }

Loading…
Cancel
Save