mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-06-20 18:58:16 +08:00
@ -15,7 +15,7 @@ public interface IUserModule : ICrudModule<CreateUserReq, QueryUserRsp // 创建
|
||||
>
|
||||
{
|
||||
/// <summary>
|
||||
/// 检查手机号是否可用
|
||||
/// 检查手机号码是否可用
|
||||
/// </summary>
|
||||
Task<bool> CheckMobileAvailableAsync(CheckMobileAvailableReq req);
|
||||
|
||||
@ -65,7 +65,7 @@ public interface IUserModule : ICrudModule<CreateUserReq, QueryUserRsp // 创建
|
||||
Task SetEnabledAsync(SetUserEnabledReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 设置手机号
|
||||
/// 设置手机号码
|
||||
/// </summary>
|
||||
Task<UserInfoRsp> SetMobileAsync(SetMobileReq req);
|
||||
|
||||
|
@ -284,14 +284,14 @@ public sealed class UserService(
|
||||
.ToOneAsync(a => new { a.Mobile, a.Version, a.Email })
|
||||
.ConfigureAwait(false);
|
||||
|
||||
// 如果已绑定手机号、需要手机安全验证
|
||||
// 如果已绑定手机号码、需要手机安全验证
|
||||
if (!user.Mobile.NullOrEmpty()) {
|
||||
if (!await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.验证码不正确);
|
||||
}
|
||||
|
||||
if (user.Mobile != req.VerifySmsCodeReq.DestDevice) {
|
||||
throw new NetAdminInvalidOperationException($"{Ln.手机号不正确}");
|
||||
throw new NetAdminInvalidOperationException($"{Ln.手机号码不正确}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,19 +328,19 @@ public sealed class UserService(
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (!user.Mobile.NullOrEmpty()) {
|
||||
// 已有手机号,需验证旧手机
|
||||
// 已有手机号码,需验证旧手机
|
||||
if (!await verifyCodeService.VerifyAsync(req.OriginVerifySmsCodeReq).ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException($"{Ln.旧手机号验证码不正确}");
|
||||
throw new NetAdminInvalidOperationException($"{Ln.旧手机号码验证码不正确}");
|
||||
}
|
||||
|
||||
if (user.Mobile != req.OriginVerifySmsCodeReq.DestDevice) {
|
||||
throw new NetAdminInvalidOperationException($"{Ln.旧手机号不正确}");
|
||||
throw new NetAdminInvalidOperationException($"{Ln.旧手机号码不正确}");
|
||||
}
|
||||
}
|
||||
|
||||
// 验证新手机号
|
||||
// 验证新手机号码
|
||||
if (!await verifyCodeService.VerifyAsync(req.NewVerifySmsCodeReq).ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException($"{Ln.新手机号验证码不正确}");
|
||||
throw new NetAdminInvalidOperationException($"{Ln.新手机号码验证码不正确}");
|
||||
}
|
||||
|
||||
if (await Rpo.UpdateDiy
|
||||
|
Reference in New Issue
Block a user