mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-06-21 03:08:16 +08:00
@ -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