AccreditController.php 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace addons\Authority\api\modules\v1\controllers;
  3. use Yii;
  4. use api\controllers\OnAuthController;
  5. use common\helpers\ResultHelper;
  6. /**
  7. * Class AccreditController
  8. * @package addons\Authority\api\modules\v1\controllers
  9. * @author jianyan74 <751393839@qq.com>
  10. */
  11. class AccreditController extends OnAuthController
  12. {
  13. public $modelClass = '';
  14. /**
  15. * 不用进行登录验证的方法
  16. *
  17. * 例如: ['index', 'update', 'create', 'view', 'delete']
  18. * 默认全部需要验证
  19. *
  20. * @var array
  21. */
  22. protected $authOptional = ['verify'];
  23. /**
  24. * @return array|mixed|string|\yii\data\ActiveDataProvider
  25. */
  26. public function actionVerify()
  27. {
  28. return ResultHelper::json(422, '系统未授权, 请联系管理员');
  29. $url = Yii::$app->request->post('url');
  30. if (empty($url)) {
  31. return ResultHelper::json(422, '系统未授权, 请联系管理员');
  32. }
  33. return 'ok';
  34. }
  35. }
粤ICP备19079148号