| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace addons\ShortVideo\api\modules\v1\controllers;
- use addons\ShortVideo\common\models\ShortVideo;
- use addons\ShortVideo\common\models\ShortVideoConfig;
- class DefaultController extends BaseController
- {
- public $modelClass = '';
- /**
- * 不用进行登录验证的方法
- *
- * 例如: ['index', 'update', 'create', 'view', 'delete']
- * 默认全部需要验证
- *
- * @var array
- */
- protected $authOptional = ['index'];
- /**
- * 首页
- *
- * @return string
- */
- public function actionIndex()
- {
- return 'Hello world';
- }
- public function actionGetConfig()
- {
- if (!\Yii::$app->request->isGet) {
- return $this->error('请求方式错误');
- }
- $configs = ShortVideoConfig::getConfig($this->mall_id);
- // dd($configs);
- return $this->success('success', $configs);
- }
- /**
- * @name:
- * @msg: 当前会员是否可以发布视频
- * @param {*}
- * @return {*}
- */
- public function actionIsCanPublish()
- {
- if (!\Yii::$app->request->isGet) {
- return $this->error('请求方式错误');
- }
- $res = ShortVideo::userCanPush($this->mall_id, $this->user_id);
- return $this->success('success', $res);
- }
- }
|