<?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');
    }
}
