Verify.php 561 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\index\controller;
  3. use think\captcha\Captcha;
  4. use think\Config;
  5. use think\Controller;
  6. class Verify extends Controller
  7. {
  8. public function __construct()
  9. {
  10. parent::__construct();
  11. }
  12. public function index($id='')
  13. {
  14. ob_end_clean();
  15. $captcha = new Captcha((array)Config::get('captcha'));
  16. return $captcha->entry($id);
  17. }
  18. public function check($verify,$id='')
  19. {
  20. if(!captcha_check($verify)){
  21. return 0;
  22. }
  23. else{
  24. return 1;
  25. }
  26. }
  27. }