From 5e3b5639a60f9c3f578240879765fa5270cd50c3 Mon Sep 17 00:00:00 2001 From: PeopleSea Date: Wed, 18 Dec 2024 02:29:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?added(JwtAuth):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=20=E5=92=8C=E5=BD=93=E5=89=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=20Interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 CurrentUserInterface 和 UserInterface - 定义了用户相关的方法和属性 - 为后续的用户认证和权限管理提供接口基础 --- .../Interfaces/CurrentUserInterface.php | 30 ++++++++++++++ src/JwtAuth/Interfaces/UserInterface.php | 41 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/JwtAuth/Interfaces/CurrentUserInterface.php create mode 100644 src/JwtAuth/Interfaces/UserInterface.php diff --git a/src/JwtAuth/Interfaces/CurrentUserInterface.php b/src/JwtAuth/Interfaces/CurrentUserInterface.php new file mode 100644 index 0000000..ff4a1b4 --- /dev/null +++ b/src/JwtAuth/Interfaces/CurrentUserInterface.php @@ -0,0 +1,30 @@ + Date: Fri, 20 Dec 2024 16:06:59 +0800 Subject: [PATCH 2/3] fix review --- src/JwtAuth/Interfaces/CurrentUserInterface.php | 4 ---- src/JwtAuth/Interfaces/UserInterface.php | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/src/JwtAuth/Interfaces/CurrentUserInterface.php b/src/JwtAuth/Interfaces/CurrentUserInterface.php index ff4a1b4..c4a6881 100644 --- a/src/JwtAuth/Interfaces/CurrentUserInterface.php +++ b/src/JwtAuth/Interfaces/CurrentUserInterface.php @@ -23,8 +23,4 @@ public function refresh(): array; public function id(): int; public function isSuperAdmin(): bool; - - public function filterCurrentUser(?array $menuTreeList = null, ?array $permissions = null): array; - - public function globalMenuTreeList(): Collection; } diff --git a/src/JwtAuth/Interfaces/UserInterface.php b/src/JwtAuth/Interfaces/UserInterface.php index 06e04e6..4c479c5 100644 --- a/src/JwtAuth/Interfaces/UserInterface.php +++ b/src/JwtAuth/Interfaces/UserInterface.php @@ -21,21 +21,9 @@ interface UserInterface { public function roles(): BelongsToMany; - public function deleted(Deleted $event); - - public function setPasswordAttribute($value): void; - - public function creating(Creating $event); - public function verifyPassword(string $password): bool; public function resetPassword(): void; public function isSuperAdmin(): bool; - - public function getRoles(array $fields): Collection; - - public function getPermissions(): Collection; - - public function hasPermission(string $permission): bool; } From 0f4efdd94d57b9d8393a651943148e23b228a4cb Mon Sep 17 00:00:00 2001 From: PeopleSea Date: Fri, 20 Dec 2024 20:44:27 +0800 Subject: [PATCH 3/3] fix cs-fix --- src/JwtAuth/Interfaces/CurrentUserInterface.php | 2 -- src/JwtAuth/Interfaces/UserInterface.php | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/JwtAuth/Interfaces/CurrentUserInterface.php b/src/JwtAuth/Interfaces/CurrentUserInterface.php index c4a6881..db637fd 100644 --- a/src/JwtAuth/Interfaces/CurrentUserInterface.php +++ b/src/JwtAuth/Interfaces/CurrentUserInterface.php @@ -12,8 +12,6 @@ namespace Mine\JwtAuth\Interfaces; -use Hyperf\Collection\Collection; - interface CurrentUserInterface { public function user(): ?UserInterface; diff --git a/src/JwtAuth/Interfaces/UserInterface.php b/src/JwtAuth/Interfaces/UserInterface.php index 4c479c5..4858b82 100644 --- a/src/JwtAuth/Interfaces/UserInterface.php +++ b/src/JwtAuth/Interfaces/UserInterface.php @@ -12,9 +12,6 @@ namespace Mine\JwtAuth\Interfaces; -use Hyperf\Collection\Collection; -use Hyperf\Database\Model\Events\Creating; -use Hyperf\Database\Model\Events\Deleted; use Hyperf\Database\Model\Relations\BelongsToMany; interface UserInterface