CaptchaVerify.php 856 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Components;
  3. /**
  4. * Class CaptchaVerify 验证码
  5. *
  6. * @package App\Components
  7. */
  8. class CaptchaVerify {
  9. //从后台获取 hcaptcha_sitekey 和 hcaptcha_secret
  10. public static function hCaptchaGetConfig(): array {
  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. return [
  20. "geetest_id" => sysConfig('geetest_id'),
  21. "geetest_key" => sysConfig('geetest_key')
  22. ];
  23. }
  24. //从后台获取 google_captcha_sitekey 和 google_captcha_secret
  25. public static function googleCaptchaGetConfig(): array {
  26. return [
  27. "sitekey" => sysConfig('google_captcha_sitekey'),
  28. "secret" => sysConfig('google_captcha_secret'),
  29. "options" => []
  30. ];
  31. }
  32. }