TripartiteApiController.php 636 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\common\components;
  3. use app\common\models\ApiAccessToken;
  4. class TripartiteApiController extends BaseController
  5. {
  6. /**
  7. * @throws \app\common\exceptions\AppException
  8. * @throws \app\common\exceptions\TokenHasExpiredException
  9. * @throws \app\common\exceptions\TokenHasRevokedException
  10. * @throws \app\common\exceptions\TokenNotFoundException
  11. */
  12. public function preAction()
  13. {
  14. $this->validate([
  15. 'access_token' => 'required',
  16. ]);
  17. ApiAccessToken::verify(\YunShop::app()->uniacid, request()->input('access_token'));
  18. parent::preAction();
  19. }
  20. }