From a8bc53f3b1c97ca24c4f45f0c4b660c6061eb3dc Mon Sep 17 00:00:00 2001 From: huzhiyun Date: Mon, 26 Jan 2026 16:33:28 +0800 Subject: [PATCH] 1 --- LearningOfficer.OA.Core/ServicesInterfaces/IUserService.cs | 2 +- .../Controllers/V1/FollowStudentInfoController.cs | 5 +++-- LearningOfficer.OA.Services/UserService.cs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/LearningOfficer.OA.Core/ServicesInterfaces/IUserService.cs b/LearningOfficer.OA.Core/ServicesInterfaces/IUserService.cs index 6678ebe..0fe3f0a 100644 --- a/LearningOfficer.OA.Core/ServicesInterfaces/IUserService.cs +++ b/LearningOfficer.OA.Core/ServicesInterfaces/IUserService.cs @@ -18,7 +18,7 @@ namespace LearningOfficer.OA.Core.ServicesInterfaces { public interface IUserService : IBaseService { - public Task ResetStudentPwd(long userId); + public Task ResetStudentPwd(long userId, string pwd); public Task> GetStudentResults(long ClassesId, int IsBackOutStudent); } } diff --git a/LearningOfficer.OA.Mobile.Api/Controllers/V1/FollowStudentInfoController.cs b/LearningOfficer.OA.Mobile.Api/Controllers/V1/FollowStudentInfoController.cs index 1d9fcc6..c196476 100644 --- a/LearningOfficer.OA.Mobile.Api/Controllers/V1/FollowStudentInfoController.cs +++ b/LearningOfficer.OA.Mobile.Api/Controllers/V1/FollowStudentInfoController.cs @@ -97,12 +97,13 @@ namespace LearningOfficer.OA.Mobile.Api.Controllers.V1 /// 重置学生密码为123456 /// /// 学生id + /// /// [HttpPost] [AllowAnonymous] - public async Task ResetStudentPwd(long userId) + public async Task ResetStudentPwd(long userId, string pwd) { - return await _userService.ResetStudentPwd(userId); + return await _userService.ResetStudentPwd(userId, pwd); } } } diff --git a/LearningOfficer.OA.Services/UserService.cs b/LearningOfficer.OA.Services/UserService.cs index f9e71b0..17596ab 100644 --- a/LearningOfficer.OA.Services/UserService.cs +++ b/LearningOfficer.OA.Services/UserService.cs @@ -78,14 +78,14 @@ namespace LearningOfficer.OA.Services }).ToListAsync(); return result; } - public async Task ResetStudentPwd(long userId) + public async Task ResetStudentPwd(long userId, string pwd) { var user = await _userRepository.GetByIdAsync(userId); if (user == null) { throw new BusinessException("用户不存在"); } - user.Password = MD5EncryptionHelper.MD5Encryption("123456"); + user.Password = MD5EncryptionHelper.MD5Encryption(pwd); //大写MD5 user.Password = user.Password.ToUpper(); return await _userRepository.UpdateAsync(user);