From 4d17fa724871eed6a4185b23a689fc7b94556b1f Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期三, 25 九月 2024 13:24:15 +0800
Subject: [PATCH] no message
---
cylsg/cylsg.Application/Users/UserAppService.cs | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/cylsg/cylsg.Application/Users/UserAppService.cs b/cylsg/cylsg.Application/Users/UserAppService.cs
index bac83be..a3f0c08 100644
--- a/cylsg/cylsg.Application/Users/UserAppService.cs
+++ b/cylsg/cylsg.Application/Users/UserAppService.cs
@@ -285,6 +285,60 @@
}
-
+
+
+ /// <summary>
+ /// 淇濆瓨鐢ㄦ埛淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ public async Task<bool> saveUser(UserDto userDto)
+ {
+
+ var UserID = App.User?.FindFirstValue("UserID");
+ int userid = 0;
+ string NickName = App.User?.FindFirstValue("NickName");
+ if (!string.IsNullOrEmpty(UserID))
+ {
+ userid = int.Parse(UserID);
+ }
+ if (!string.IsNullOrEmpty(userDto.Nickname) && userDto.Nickname.Length > 100)
+ {
+ throw Oops.Oh("鏄电О闀垮害杩囬暱锛�");
+ }
+ if (!string.IsNullOrEmpty(userDto.Avatar) && userDto.Avatar.Length > 500)
+ {
+ throw Oops.Oh("澶村儚闀垮害杩囬暱锛�");
+ }
+
+
+ var userRes = new BaseRepository<User>();
+ bool res;
+
+ var user = await userRes.GetByIdAsync(userid);
+
+ if (!string.IsNullOrEmpty(userDto.Nickname))
+ user.Nickname = userDto.Nickname;
+ if (!string.IsNullOrEmpty(userDto.Avatar))
+ user.Avatar = userDto.Avatar;
+
+
+ user.UpDataBy = NickName;
+ user.UpDataTime = DateTime.Now;
+ res = await userRes.UpdateAsync(user);
+
+
+
+
+
+
+
+
+
+
+ return res;
+ }
+
+
+
}
}
--
Gitblit v1.9.1