-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added(JwtAuth): 添加用户 和当前用户 Interface (#140)
* added(JwtAuth): 添加用户 和当前用户 Interface - 新增 CurrentUserInterface 和 UserInterface - 定义了用户相关的方法和属性 - 为后续的用户认证和权限管理提供接口基础 * fix review * fix cs-fix
- Loading branch information
1 parent
ccfe015
commit 1e63d4f
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of MineAdmin. | ||
* | ||
* @link https://www.mineadmin.com | ||
* @document https://doc.mineadmin.com | ||
* @contact [email protected] | ||
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE | ||
*/ | ||
|
||
namespace Mine\JwtAuth\Interfaces; | ||
|
||
interface CurrentUserInterface | ||
{ | ||
public function user(): ?UserInterface; | ||
|
||
public function refresh(): array; | ||
|
||
public function id(): int; | ||
|
||
public function isSuperAdmin(): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of MineAdmin. | ||
* | ||
* @link https://www.mineadmin.com | ||
* @document https://doc.mineadmin.com | ||
* @contact [email protected] | ||
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE | ||
*/ | ||
|
||
namespace Mine\JwtAuth\Interfaces; | ||
|
||
use Hyperf\Database\Model\Relations\BelongsToMany; | ||
|
||
interface UserInterface | ||
{ | ||
public function roles(): BelongsToMany; | ||
|
||
public function verifyPassword(string $password): bool; | ||
|
||
public function resetPassword(): void; | ||
|
||
public function isSuperAdmin(): bool; | ||
} |