feat: 框架代码同步 (#130)

[skip ci]
This commit is contained in:
2024-05-29 15:03:05 +08:00
committed by GitHub
parent b01b8b24ba
commit 5edcf63e24
13 changed files with 28 additions and 28 deletions

View File

@ -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