Skip to content

Commit cc89f6f

Browse files
committed
获取token相应用户的uid
1 parent b969870 commit cc89f6f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Jwt.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,15 @@ public function user()
374374
return $this->user;
375375
}
376376

377+
/**
378+
* 获取用户uid
379+
* @return mixed
380+
*/
381+
public function userId(){
382+
$uid = $this->token->getClaim($this->ssoKey());
383+
return $uid;
384+
}
385+
377386
public function getClaims()
378387
{
379388
return $this->token->getClaims();

0 commit comments

Comments
 (0)