更新部分显示样式

This commit is contained in:
wyf
2025-12-09 15:47:05 +08:00
parent 5e63f2dfdc
commit e7c51bea52
15 changed files with 223 additions and 122 deletions

View File

@@ -146,7 +146,12 @@ class UserInfoController extends GetControllerEx<UserInfoModel> {
LoginController loginController = Get.find();
ApiResponse apiResponse = ApiResponse(code: -1, msg: "保存失败".tr);
UserModel user = model.user!;
if (user.tmpNickName == null || user.tmpNickName!.isEmpty) {
final bool hasContactUpdate = (phone != null && phone.isNotEmpty) ||
(email != null && email.isNotEmpty);
/// 只有在【没有更新 phone/email】时才要求昵称不为空
if (!hasContactUpdate &&
(user.tmpNickName == null || user.tmpNickName!.isEmpty)) {
apiResponse.msg = "昵称为空".tr;
return apiResponse;
}