CaptchaVerify.php 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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()
  12. {
  13. return [
  14. "sitekey" => Helpers::systemConfig()["hcaptcha_sitekey"],
  15. "secret" => Helpers::systemConfig()["hcaptcha_secret"],
  16. "options" => []
  17. ];
  18. }
  19. //从后台获取 Geetest_id 和 Geetest_key
  20. public static function geetestCaptchaGetConfig()
  21. {
  22. return [
  23. "geetest_id" => Helpers::systemConfig()["geetest_id"],
  24. "geetest_key" => Helpers::systemConfig()["geetest_key"]
  25. ];
  26. }
  27. //从后台获取 google_captcha_sitekey 和 google_captcha_secret
  28. public static function googleCaptchaGetConfig()
  29. {
  30. return [
  31. "sitekey" => Helpers::systemConfig()["google_captcha_sitekey"],
  32. "secret" => Helpers::systemConfig()["google_captcha_secret"],
  33. "options" => []
  34. ];
  35. }
  36. }
  37. ?>