PassportController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\client\controllers\v1\alipay;
  8. use app\modules\client\models\v1\alipay\AuthForm;
  9. use yii\base\BaseObject;
  10. class PassportController extends BaseController
  11. {
  12. public function actionAuth()
  13. {
  14. $from = new AuthForm();
  15. $from->attributes = all_params();
  16. $from->socialite = $this->socialite;
  17. $from->store_id = get_store_id();
  18. return $this->asJson($from->codeAnalysis());
  19. }
  20. public function actionPhone() {
  21. $from = new AuthForm();
  22. $from->mini_id = get_params('mini_id');
  23. $from->attributes = post_params();
  24. $from->socialite = $this->socialite;
  25. $from->store_id = get_store_id();
  26. return $this->asJson($from->analysisPhone());
  27. }
  28. public function actionLogin()
  29. {
  30. $from = new AuthForm();
  31. $from->mini_id = get_params('mini_id');
  32. $from->attributes = post_params();
  33. $from->socialite = $this->socialite;
  34. $from->store_id = get_store_id();
  35. return $this->asJson($from->login());
  36. }
  37. }