mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-05-10 02:44:27 +08:00
1. 维护代码健壮
2. 更新项目结构文档
This commit is contained in:
@@ -43,7 +43,7 @@ class AdminAuthService extends BaseService
|
||||
*/
|
||||
public function authenticateToken(string $token, string $ip = '', string $userAgent = ''): ?AdminUser
|
||||
{
|
||||
$result = $this->jwtTokenManager->verify('admin', $token, $ip, $userAgent);
|
||||
$result = $this->jwtTokenManager->verify(AuthConstant::GUARD_ADMIN, $token, $ip, $userAgent);
|
||||
if ($result === null) {
|
||||
return null;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class AdminAuthService extends BaseService
|
||||
*/
|
||||
public function revokeToken(string $token): bool
|
||||
{
|
||||
return $this->jwtTokenManager->revoke('admin', $token);
|
||||
return $this->jwtTokenManager->revoke(AuthConstant::GUARD_ADMIN, $token);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ class AdminAuthService extends BaseService
|
||||
throw new ValidationException('管理员不存在');
|
||||
}
|
||||
|
||||
$issued = $this->jwtTokenManager->issue('admin', [
|
||||
$issued = $this->jwtTokenManager->issue(AuthConstant::GUARD_ADMIN, [
|
||||
'sub' => (string) $adminId,
|
||||
'admin_id' => $adminId,
|
||||
'username' => (string) $admin->username,
|
||||
@@ -143,4 +143,3 @@ class AdminAuthService extends BaseService
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user