CaptchaVerify.php 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Components;
  3. /**
  4. * Class CaptchaVerify 验证码
  5. *
  6. * @package App\Components
  7. */
  8. class CaptchaVerify
  9. {
  10. //从后台获取 hcaptcha_sitekey 和 hcaptcha_secret
  11. public static function hCaptchaGetConfig(): array
  12. {
  13. return [
  14. "sitekey" => sysConfig('hcaptcha_sitekey'),
  15. "secret" => sysConfig('hcaptcha_secret'),
  16. "options" => [],
  17. ];
  18. }
  19. //从后台获取 Geetest_id 和 Geetest_key
  20. public static function geetestCaptchaGetConfig(): array
  21. {
  22. return [
  23. "geetest_id" => sysConfig('geetest_id'),
  24. "geetest_key" => sysConfig('geetest_key'),
  25. ];
  26. }
  27. //从后台获取 google_captcha_sitekey 和 google_captcha_secret
  28. public static function googleCaptchaGetConfig(): array
  29. {
  30. return [
  31. "sitekey" => sysConfig('google_captcha_sitekey'),
  32. "secret" => sysConfig('google_captcha_secret'),
  33. "options" => [],
  34. ];
  35. }
  36. }