User.php 594 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Created by PhpStorm
  4. * User:林志杰
  5. * Email:[email protected]
  6. * Motto:纵有疾风起,人生不言弃!
  7. * Time:2020/2/8 23:12
  8. */
  9. namespace app\api\controller;
  10. use app\common\business\User as UserBusiness;
  11. class User extends AuthBase
  12. {
  13. public function index()
  14. {
  15. $user = (new UserBusiness)->getNormalUserById($this->userId);
  16. $resultUser = [
  17. 'id' => $this->userId,
  18. 'username' => $user['username'],
  19. 'sex' => $user['sex'],
  20. ];
  21. return show(config('status.success'), 'OK', $resultUser);
  22. }
  23. }