feat : config

This commit is contained in:
2025-03-20 15:29:13 +08:00
parent d3d0cda616
commit 3069744bfa

View File

@@ -26,7 +26,7 @@ class UserCache
public function setUserToken(int $userId,string $token): void public function setUserToken(int $userId,string $token): void
{ {
$key = CommonRedisKey::userTokenHashKey(); $key = CommonRedisKey::userTokenHashKey();
$this->redis->hSet($key, $userId, $token); $this->redis->hSet($key, (string)$userId, $token);
} }
/** /**
@@ -38,7 +38,7 @@ class UserCache
public function getUserToken(int $userId): mixed public function getUserToken(int $userId): mixed
{ {
$key = CommonRedisKey::userTokenHashKey(); $key = CommonRedisKey::userTokenHashKey();
return $this->redis->hGet($key, $userId); return $this->redis->hGet($key, (string)$userId);
} }
/** /**
@@ -50,6 +50,6 @@ class UserCache
public function removeUserToken(int $userId): void public function removeUserToken(int $userId): void
{ {
$key = CommonRedisKey::userTokenHashKey(); $key = CommonRedisKey::userTokenHashKey();
$this->redis->hDel($key, $userId); $this->redis->hDel($key, (string)$userId);
} }
} }