DefaultController.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\common\controllers;
  8. use app\models\AgentFrontBind;
  9. use app\models\OldUserTreePath;
  10. use app\models\Order;
  11. use app\models\Share;
  12. use app\models\ShareGroupMoney;
  13. use app\models\ShareGroupPurchaseParentLog;
  14. use app\models\User;
  15. use app\models\ShareHolder;
  16. use app\models\ShareHolderLevel;
  17. use app\models\UserTreePath;
  18. use app\modules\client\models\v1\ShareQrcodeForm;
  19. use app\utils\Share\BonusPool;
  20. use yii\filters\AccessControl;
  21. use yii\web\Controller;
  22. use yii\filters\VerbFilter;
  23. class DefaultController extends Controller
  24. {
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function behaviors()
  29. {
  30. return [
  31. 'verbs' => [
  32. 'class' => VerbFilter::class,
  33. 'actions' => [
  34. 'logout' => ['post'],
  35. ],
  36. ],
  37. ];
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function actions()
  43. {
  44. return [
  45. 'error' => [
  46. 'class' => 'yii\web\ErrorAction',
  47. 'layout' => false,
  48. ],
  49. 'captcha' => [
  50. 'class' => 'yii\captcha\CaptchaAction',
  51. 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
  52. ],
  53. ];
  54. }
  55. /**
  56. * default action
  57. *
  58. * @return string
  59. */
  60. public function actionIndex()
  61. {
  62. return $this->redirect('/admin');
  63. }
  64. public function actionResetProd()
  65. {
  66. return $this->asJson(\Yii::$app->resetProd());
  67. }
  68. public function actionSetCloudAccount()
  69. {
  70. $key = \Yii::$app->request->get('key');
  71. return $this->asJson(\Yii::$app->setCloudAccount($key));
  72. }
  73. }