BaseController.php 610 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace addons\ShortVideo\api\modules\v1\controllers;
  3. use addons\ShortVideo\common\models\ShortVideoConfig;
  4. use api\controllers\OnAuthController;
  5. /**
  6. * 默认控制器
  7. *
  8. * Class DefaultController
  9. * @package addons\ShortVideo\api\modules\v1\controllers
  10. */
  11. class BaseController extends OnAuthController
  12. {
  13. public function beforeAction($action)
  14. {
  15. parent::beforeAction($action);
  16. $configs = ShortVideoConfig::getConfig($this->mall_id);
  17. if (empty($configs) || 1 != $configs['is_enabled']) return $this->error('短视频插件未启用');
  18. return $action;
  19. }
  20. }