From c117ddfe7a433215b3449cdd6b19318a1f3cbf37 Mon Sep 17 00:00:00 2001 From: nsnail Date: Sat, 2 Mar 2024 23:23:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E4=BD=8E=E7=89=88?= =?UTF-8?q?=E6=9C=ACjetbrains.resharper.globaltools=E6=90=9E=E4=B9=B1?= =?UTF-8?q?=E4=BA=86=E4=BB=A3=E7=A0=81=20(#97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dotnet-tools.json | 18 ------------------ .../DataValidation/UserIdAttribute.cs | 2 +- .../Utils/CaptchaImageHelper.cs | 4 +--- .../Services/Sys/VerifyCodeService.cs | 4 +--- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/dotnet-tools.json b/dotnet-tools.json index 05d31eed..64cfe121 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -7,24 +7,6 @@ "commands": [ "t4" ] - }, - "dotnet-script": { - "version": "1.5.0", - "commands": [ - "dotnet-script" - ] - }, - "jetbrains.resharper.globaltools": { - "version": "2023.3.3", - "commands": [ - "jb" - ] - }, - "dnt": { - "version": "1.9.0", - "commands": [ - "dnt" - ] } } } \ No newline at end of file diff --git a/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs b/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs index 5716e212..1e59fc1b 100644 --- a/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs +++ b/src/backend/NetAdmin.Domain/Attributes/DataValidation/UserIdAttribute.cs @@ -18,7 +18,7 @@ public sealed class UserIdAttribute : ValidationAttribute var req = new QueryReq { Filter = new QueryUserReq { Id = (long)value! } }; var method = service.GetType().GetMethod("ExistAsync"); - var exist = (Task)method!.Invoke(service, [req])!.ConfigureAwait(false).GetAwaiter().GetResult(); + var exist = ((Task)method!.Invoke(service, [req]))!.ConfigureAwait(false).GetAwaiter().GetResult(); return !exist ? new ValidationResult(Ln.用户编号不存在) : ValidationResult.Success; } } \ No newline at end of file diff --git a/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs b/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs index cf37e079..19cc819f 100644 --- a/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs +++ b/src/backend/NetAdmin.Infrastructure/Utils/CaptchaImageHelper.cs @@ -12,7 +12,7 @@ namespace NetAdmin.Infrastructure.Utils; /// public static class CaptchaImageHelper { - private static readonly int[] _randRange = + private static readonly int[] _randRange = [70, 100]; /// /// 创建一个缺口滑块验证码图片 @@ -182,6 +182,4 @@ public static class CaptchaImageHelper { return (endNum > startNum ? new[] { 0, endNum - startNum }.Rand() : 0) + startNum; } - - [70, 100]; } \ No newline at end of file diff --git a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs index 874d2558..310d0a41 100644 --- a/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs +++ b/src/backend/NetAdmin.SysComponent.Application/Services/Sys/VerifyCodeService.cs @@ -14,7 +14,7 @@ namespace NetAdmin.SysComponent.Application.Services.Sys; public sealed class VerifyCodeService(DefaultRepository rpo, IEventPublisher eventPublisher) // : RepositoryService(rpo), IVerifyCodeService { - private static readonly int[] _randRange = + private static readonly int[] _randRange = [0, 10000]; /// public async Task BulkDeleteAsync(BulkReq req) @@ -163,8 +163,6 @@ public sealed class VerifyCodeService(DefaultRepository rpo, IEv : await GetAsync(new QueryVerifyCodeReq { Id = req.Id }).ConfigureAwait(false); } - [0, 10000]; - private Task GetLastSentAsync(string destDevice) { return QueryInternal(new QueryReq {