\Mine\HelperLoginUser

Summary

Methods
Properties
Constants
__construct()
check()
getJwt()
getUserInfo()
getId()
getUsername()
getRole()
getUserType()
getDeptId()
isSuperAdmin()
isAdminRole()
getToken()
refresh()
No public properties found
No constants found
No protected methods found
$jwt
$request
N/A
No private methods found
No private properties found
N/A

Properties

$jwt

$jwt : \Phper666\JWTAuth\JWT

Type

\Phper666\JWTAuth\JWT

Methods

__construct()

__construct(string  $scene = 'default') 

LoginUser constructor.

Parameters

string $scene

场景,默认为default

check()

check() : boolean

验证token

Throws

\Psr\Container\ContainerExceptionInterface
\Psr\Container\NotFoundExceptionInterface

Returns

boolean

getJwt()

getJwt() : \Mine\Helper\Jwt

获取JWT对象

Returns

\Mine\Helper\Jwt

getUserInfo()

getUserInfo() : array

获取当前登录用户信息

Returns

array

getId()

getId() : string

获取当前登录用户ID

Returns

string

getUsername()

getUsername() : string

获取当前登录用户名

Returns

string

getRole()

getRole() : string

获取当前token用户角色

Returns

string

getUserType()

getUserType() : string

获取当前token用户类型

Returns

string

getDeptId()

getDeptId() : string

获取当前token用户部门ID

Returns

string

isSuperAdmin()

isSuperAdmin() : boolean

是否为超级管理员(创始人),用户禁用对创始人没用

Returns

boolean

isAdminRole()

isAdminRole() : boolean

是否为管理员角色

Returns

boolean

getToken()

getToken(array  $user) : string

获取Token

Parameters

array $user

Throws

\Psr\SimpleCache\InvalidArgumentException

Returns

string

refresh()

refresh() : string

刷新token

Throws

\Psr\SimpleCache\InvalidArgumentException

Returns

string