上传bug
This commit is contained in:
@@ -53,16 +53,6 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
}
|
||||
|
||||
////查找改邮箱或者手机的用户
|
||||
//var exist = await _userRepository.AnyAsync(t => t.EMail == email);
|
||||
|
||||
//if (!exist)
|
||||
//{
|
||||
// return ResponseOutput.NotOk("No user with this email exists.");
|
||||
|
||||
//}
|
||||
//var user = await _userRepository.FirstOrDefaultAsync(t => t.EMail == email);
|
||||
|
||||
|
||||
//验证码 6位
|
||||
int verificationCode = new Random().Next(100000, 1000000);
|
||||
@@ -73,6 +63,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
}
|
||||
|
||||
|
||||
[HttpPut("{newEmail}/{verificationCode}")]
|
||||
public async Task<IResponseOutput> SetNewEmail(string newEmail, string verificationCode)
|
||||
{
|
||||
@@ -108,15 +99,15 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.NotOk("The mailbox for this user type already exists");
|
||||
}
|
||||
|
||||
var success = await _userRepository.BatchUpdateAsync(t => t.Id == _userInfo.Id, u => new User()
|
||||
await _userRepository.UpdatePartialFields(_userInfo.Id, u => new User()
|
||||
{
|
||||
EMail = newEmail
|
||||
});
|
||||
}, true);
|
||||
|
||||
//删除验证码历史记录
|
||||
await _verificationCodeRepository.BatchDeleteAsync(t => t.UserId == _userInfo.Id && t.CodeType == 0);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -128,10 +119,10 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
||||
|
||||
var success = await _userRepository.BatchUpdateAsync(t => t.Id == _userInfo.Id, u => new User()
|
||||
await _userRepository.UpdatePartialFields(_userInfo.Id, u => new User()
|
||||
{
|
||||
Phone = newPhone
|
||||
});
|
||||
},true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -145,10 +136,10 @@ namespace IRaCIS.Application.Services
|
||||
{
|
||||
return ResponseOutput.NotOk("UserId already exists");
|
||||
}
|
||||
var success = await _userRepository.BatchUpdateAsync(t => t.Id == _userInfo.Id, u => new User()
|
||||
await _userRepository.UpdatePartialFields(_userInfo.Id, u => new User()
|
||||
{
|
||||
UserName = newUserName
|
||||
});
|
||||
},true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
@@ -163,13 +154,13 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task<IResponseOutput> ResetPassword(Guid userId)
|
||||
{
|
||||
var success = await _userRepository.BatchUpdateAsync(t => t.Id == userId, u => new User()
|
||||
await _userRepository.UpdatePartialFields(userId, u => new User()
|
||||
{
|
||||
Password = MD5Helper.Md5(StaticData.DefaultPassword),
|
||||
IsFirstAdd = true
|
||||
});
|
||||
}, true);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user