12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App\Client;
- class Site
- {
- protected $site;
- public function __construct()
- {
- $this->site = app()->make('siteData');
- }
- /**
- * 获取用户id
- *
- * @return mixed
- */
- public function getUid()
- {
- return (int)getProp($this->site, 'uid');
- }
- /**
- * 获取用户角色
- *
- * @return mixed
- */
- public function getRole()
- {
- return (string)getProp($this->site, 'role');
- }
- /**
- * 获取用户昵称
- *
- * @return mixed
- */
- public function getNickname()
- {
- return (string)getProp($this->site, 'nickname');
- }
- /**
- * 获取用户token
- *
- * @return mixed
- */
- public function getToken()
- {
- return (string)getProp($this->site, 'token');
- }
- }
|