CaptchaVerify.php 971 B

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