Common.php 837 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\controller\common;
  3. use app\extra\basic\Base;
  4. use app\model\system\SystemConfig;
  5. use LinFly\Annotation\Route\Controller;
  6. use LinFly\Annotation\Route\Middleware;
  7. use LinFly\Annotation\Route\Route;
  8. use support\Response;
  9. use Tinywan\Captcha\Captcha;
  10. /**
  11. *
  12. */
  13. #[Controller(prefix: "/api/service")]
  14. class Common extends Base
  15. {
  16. /**
  17. *
  18. */
  19. #[Route(path: "data",methods: "get")]
  20. public function getServiceData(): Response
  21. {
  22. try {
  23. $captcha = Captcha::base64();
  24. $service = (new SystemConfig)->where("type","service")->column("value","name");
  25. return successTrans("success.data",compact('captcha','service'));
  26. } catch (\Throwable $throwable) {
  27. return error($throwable->getMessage());
  28. }
  29. }
  30. }