ApiBase.php 730 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Created by PhpStorm
  4. * User:林志杰
  5. * Email:[email protected]
  6. * Motto:纵有疾风起,人生不言弃!
  7. * Time:2020/2/8 20:06
  8. */
  9. namespace app\api\controller;
  10. use app\BaseController;
  11. use think\exception\HttpResponseException;
  12. /**
  13. * API模块下的公共控制器
  14. * 如果不需要登录的场景继承ApiBase这个控制器
  15. * 如果需要登录的场景继承AuthBase这个控制器
  16. * Class ApiBase
  17. * @package app\api\controller
  18. */
  19. class ApiBase extends BaseController
  20. {
  21. public function initialize()
  22. {
  23. parent::initialize(); // TODO: Change the autogenerated stub
  24. }
  25. public function show(...$args)
  26. {
  27. throw new HttpResponseException(show(...$args));
  28. }
  29. }