Commit ef0fda59 by 王召彬

修改User.php

parent 9684a6a2
......@@ -15,7 +15,7 @@ use Hdll\Services\Common\Enum\TestEnum;
use Swoft\App;
use Swoft\Bean\Annotation\Bean;
use Swoft\Core\RequestContext;
use Swoft\Redis\Redis;
use Hdll\Services\Common\Lib\Redis;
/**
* 用户实体
......@@ -165,8 +165,12 @@ class User
return [false,AuthError::GET_TOKEN_ERROR];
}
$redis = App::getBean(Redis::class);
$info = $redis->get("AUTH:".$token);
/**
* @var Redis $redis
*/
$redis = new Redis();
$redis->setPrefix("AUTH:");
$info = $redis->get($token);
if ( empty($info) ) {
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