Commit 51cd1910 by feixiang

redis 获取修改

parent b1ba4950
...@@ -12,9 +12,10 @@ namespace Hdll\Services\Common\Entity; ...@@ -12,9 +12,10 @@ namespace Hdll\Services\Common\Entity;
use Hdll\Services\Auth\Enum\AuthError; use Hdll\Services\Auth\Enum\AuthError;
use Hdll\Services\Common\Enum\TestEnum; use Hdll\Services\Common\Enum\TestEnum;
use Hdll\Services\Common\Lib\Redis; use Swoft\App;
use Swoft\Bean\Annotation\Bean; use Swoft\Bean\Annotation\Bean;
use Swoft\Core\RequestContext; use Swoft\Core\RequestContext;
use Swoft\Redis\Redis;
/** /**
* 用户实体 * 用户实体
...@@ -164,12 +165,8 @@ class User ...@@ -164,12 +165,8 @@ class User
return [false,AuthError::GET_TOKEN_ERROR]; return [false,AuthError::GET_TOKEN_ERROR];
} }
/** $redis = App::getBean(Redis::class);
* @var Redis $redis $info = $redis->get("AUTH:".$token);
*/
$redis = new Redis();
$redis->setPrefix("AUTH:");
$info = $redis->get($token);
if ( empty($info) ) { if ( empty($info) ) {
return [false,AuthError::NOT_FOUND_USER]; return [false,AuthError::NOT_FOUND_USER];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment