Преглед на файлове

修复安全验证不通过提示

zhontai преди 2 години
родител
ревизия
b773b1ae68
променени са 2 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 1 1
      src/hosts/ZhonTai.Host/Configs/appconfig.json
  2. 6 3
      src/platform/ZhonTai.Admin/Services/Auth/AuthService.cs

+ 1 - 1
src/hosts/ZhonTai.Host/Configs/appconfig.json

@@ -30,7 +30,7 @@
       {
       {
         "name": "中台Admin",
         "name": "中台Admin",
         "code": "admin",
         "code": "admin",
-        "version": "v3.0.0",
+        "version": "v3.0.1",
         "description": ""
         "description": ""
       }
       }
     ]
     ]

+ 6 - 3
src/platform/ZhonTai.Admin/Services/Auth/AuthService.cs

@@ -348,10 +348,13 @@ public class AuthService : BaseService, IAuthService, IDynamicApi
     [AllowAnonymous]
     [AllowAnonymous]
     [NoOprationLog]
     [NoOprationLog]
     [EnableCors(AdminConsts.AllowAnyPolicyName)]
     [EnableCors(AdminConsts.AllowAnyPolicyName)]
-    public async Task<bool> CheckCaptcha([FromQuery] CaptchaInput input)
+    public async Task CheckCaptcha([FromQuery] CaptchaInput input)
     {
     {
         input.CaptchaKey = CacheKeys.Captcha;
         input.CaptchaKey = CacheKeys.Captcha;
-        var result = await _captchaTool.CheckAsync(input);
-        return result;
+        var check = await _captchaTool.CheckAsync(input);
+        if (!check)
+        {
+            throw ResultOutput.Exception("安全验证不通过");
+        }
     }
     }
 }
 }