Page.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\controller\api;
  3. use app\extra\basic\Base;
  4. use LinFly\Annotation\Route\Controller;
  5. use LinFly\Annotation\Route\Route;
  6. use support\Request;
  7. use support\Response;
  8. #[Controller(prefix: "/wx_api/page")]
  9. class Page extends Base
  10. {
  11. #[Route(path: "about",methods: "get")]
  12. public function getAbout(Request $request)
  13. {
  14. try {
  15. $data = sConf("page.about");
  16. return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
  17. } catch (\Throwable $throwable) {
  18. return error($throwable->getMessage());
  19. }
  20. }
  21. #[Route(path: "privacy",methods: "get")]
  22. public function getPrivacy(Request $request)
  23. {
  24. try {
  25. $data = sConf("page.privacy");
  26. return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
  27. } catch (\Throwable $throwable) {
  28. return error($throwable->getMessage());
  29. }
  30. }
  31. #[Route(path: "agreements",methods: "get")]
  32. public function getAgreements(Request $request)
  33. {
  34. try {
  35. $data = sConf("page.agreements");
  36. return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
  37. } catch (\Throwable $throwable) {
  38. return error($throwable->getMessage());
  39. }
  40. }
  41. }