Skip to content

Commit 04be314

Browse files
committed
读取用户ID
1 parent 62c9d92 commit 04be314

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Functions.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,15 @@ function di(?string $id = null)
2222

2323
return $container;
2424
}
25+
26+
/**
27+
* 读取用户ID.
28+
*/
29+
function get_user_id(bool $build = true): int
30+
{
31+
$userAuth = UserAuth::get();
32+
if ($build) {
33+
$userAuth->build();
34+
}
35+
return $userAuth->getId();
36+
}

0 commit comments

Comments
 (0)