1
0
Эх сурвалжийг харах

升级nuge包,测试库使用滑块验证登录

zhontai 3 жил өмнө
parent
commit
ba269dda4d

+ 4 - 4
Admin.Core.Common/Admin.Core.Common.csproj

@@ -34,15 +34,15 @@
     <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
     <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
-    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.12.0" />
+    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.12.2" />
     <PackageReference Include="System.Drawing.Common" Version="5.0.2" />
-    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.0" />
+    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
     <PackageReference Include="UAParser" Version="3.1.47" />
     <PackageReference Include="Yitter.IdGenerator" Version="1.0.12" />
 	<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
 	<PackageReference Include="Autofac.Extras.DynamicProxy" Version="6.0.0" />
-	<PackageReference Include="NLog" Version="4.7.10" />
-	<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
+	<PackageReference Include="NLog" Version="4.7.11" />
+	<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
   </ItemGroup>
 
 </Project>

+ 2 - 2
Admin.Core.Tests/Admin.Core.Tests.csproj

@@ -7,8 +7,8 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.8" />
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
+    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.9" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
       <PrivateAssets>all</PrivateAssets>

+ 6 - 6
Admin.Core.Tests/Controller/BaseControllerTest.cs

@@ -4,6 +4,7 @@ using Admin.Core.Common.Output;
 using Admin.Core.Service.Admin.Auth;
 using Admin.Core.Service.Admin.Auth.Input;
 using Admin.Core.Service.Admin.Auth.Output;
+using Admin.Tools.Captcha;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Newtonsoft.Json.Serialization;
@@ -23,13 +24,13 @@ namespace Admin.Core.Tests.Controller
     public class BaseControllerTest : BaseTest
     {
         private readonly ICache _cache;
-        private readonly IAuthService _authService;
+        private readonly ICaptcha _captcha;
         private readonly AppConfig _appConfig;
 
         protected BaseControllerTest()
         {
             _cache = GetService<ICache>();
-            _authService = GetService<IAuthService>();
+            _captcha = GetService<ICaptcha>();
             _appConfig = GetService<AppConfig>();
         }
 
@@ -120,15 +121,14 @@ namespace Admin.Core.Tests.Controller
 
             if (input == null && _appConfig.VarifyCode.Enable)
             {
-                var res = await _authService.GetVerifyCodeAsync("") as IResponseOutput<AuthGetVerifyCodeOutput>;
-                var verifyCodeKey = string.Format(CacheKey.VerifyCodeKey, res.Data.Key);
+                var res = await _captcha.GetAsync();
+                var verifyCodeKey = string.Format(CacheKey.VerifyCodeKey, res.Token);
                 var verifyCode = await _cache.GetAsync(verifyCodeKey);
                 input = new AuthLoginInput()
                 {
                     UserName = "admin",
                     Password = "111111",
-                    VerifyCodeKey = res.Data.Key,
-                    VerifyCode = verifyCode
+                    Captcha = new CaptchaInput { Token = res.Token, Data = JsonConvert.SerializeObject(new { X = verifyCode }) }
                 };
             }
 

+ 33 - 3
Admin.Core/Admin.Core.csproj

@@ -46,10 +46,10 @@
     <PackageReference Include="Autofac.Extras.DynamicProxy" Version="6.0.0" />
     <PackageReference Include="Caching.CSRedis" Version="3.6.60" />
     <PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.0.0" />
-    <PackageReference Include="FluentValidation.AspNetCore" Version="10.3.0" />
+    <PackageReference Include="FluentValidation.AspNetCore" Version="10.3.3" />
     <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
-    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.8" />
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.8" />
+    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.9" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.9" />
     <PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />   
     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.5" />
   </ItemGroup>
@@ -78,6 +78,36 @@
     <Folder Include="Properties\PublishProfiles\" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Content Update="wwwroot\captcha\jigsaw\1.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\2.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\3.jpg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\templates\1.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\templates\2.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\templates\3.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\templates\4.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\templates\5.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Update="wwwroot\captcha\jigsaw\templates\6.png">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+
   <ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
 
 </Project>