UserController.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: NODELOG
  5. * DateTime: 2017/3/8 10:09
  6. * Description:
  7. */
  8. namespace api\modules\v1\controllers;
  9. use abei2017\wx\Application;
  10. use abei2017\wx\mini\qrcode\Qrcode;
  11. use api\common\behaviors\QueryParamAuth;
  12. use api\common\controllers\Controller;
  13. use api\common\models\User;
  14. use api\modules\v1\models\UserEditForm;
  15. use common\enums\CodeEnum;
  16. use common\models\Store;
  17. use common\models\Voice;
  18. use common\modules\attachment\models\Attachment;
  19. use Yii;
  20. use yii\base\Exception;
  21. use yii\helpers\ArrayHelper;
  22. use yii\web\NotFoundHttpException;
  23. use yii\web\ServerErrorHttpException;
  24. class UserController extends Controller
  25. {
  26. public function behaviors()
  27. {
  28. return ArrayHelper::merge(parent::behaviors(), [
  29. [
  30. 'class' => QueryParamAuth::className(),
  31. 'tokenParam' => 'token',
  32. ]
  33. ]);
  34. }
  35. /**
  36. * 刷新用户信息
  37. * @return array
  38. * @author nodelog
  39. */
  40. public function actionRefresh()
  41. {
  42. // request()->setQueryParams(['expand' => 'profile,qrcode,count,countMenu']);
  43. return ['data' => User::findOne(Yii::$app->user->id)];
  44. }
  45. }