CommonController.php 840 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. *
  11. */
  12. namespace App\Controller\Api;
  13. use App\Model\User;
  14. use App\Service\CaptchService;
  15. use Hyperf\HttpServer\Annotation\AutoController;
  16. use Hyperf\HttpServer\Annotation\RequestMapping;
  17. use Hyperf\RateLimit\Annotation\RateLimit;
  18. /**
  19. * Class LotteryController
  20. * @package App\Controller\Api
  21. * @AutoController()
  22. */
  23. class CommonController extends BaseController
  24. {
  25. /**
  26. * 获取图形验证码
  27. * @RequestMapping(path="get_captcha", methods="get,post")
  28. * @RateLimit(create=1, capacity=3)
  29. */
  30. public function verifyCode()
  31. {
  32. return CaptchService::makeCode();
  33. }
  34. }