webman Auth多用户认证/单点登入(JWT,SESSION) 退出登录报错

yuyu

问题描述

开启了单点登录退出报错,关闭可以退出

程序代码

public function logout()
    {
        Auth::logout(); //退出当前用户
        return redirect('/admin/login');
    }

报错信息

ErrorException: Array to string conversion in F:\admin\webman\vendor\illuminate\redis\Connections\Connection.php:116
Stack trace:
#0 [internal function]: support\App::{closure}(8, 'Array to string...', 'F:\\admin\\webman...', 116, Array)
#1 F:\admin\webman\vendor\illuminate\redis\Connections\Connection.php(116): Redis->hDel('token_user', Array)
#2 F:\admin\webman\vendor\illuminate\redis\Connections\PhpRedisConnection.php(538): Illuminate\Redis\Connections\Connection->command('hdel', Array)
#3 F:\admin\webman\vendor\illuminate\redis\Connections\Connection.php(220): Illuminate\Redis\Connections\PhpRedisConnection->command('hdel', Array)
#4 F:\admin\webman\vendor\illuminate\redis\Connections\PhpRedisConnection.php(580): Illuminate\Redis\Connections\Connection->__call('hdel', Array)
#5 F:\admin\webman\vendor\workerman\webman-framework\src\support\Redis.php(277): Illuminate\Redis\Connections\PhpRedisConnection->__call('hDel', Array)
#6 F:\admin\webman\vendor\shopwwi\webman-auth\src\JWT.php(318): support\Redis::__callStatic('hDel', Array)
#7 F:\admin\webman\vendor\shopwwi\webman-auth\src\Auth.php(262): Shopwwi\WebmanAuth\JWT->logout(false)
#8 F:\admin\webman\vendor\shopwwi\webman-auth\src\Facade\Auth.php(39): Shopwwi\WebmanAuth\Auth->logout()
#9 F:\admin\webman\app\admin\controller\Main.php(113): Shopwwi\WebmanAuth\Facade\Auth::__callStatic('logout', Array)
#10 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(284): app\admin\controller\Main->logout(Object(support\Request))
#11 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(304): Webman\App::Webman\{closure}(Object(support\Request))
#12 F:\admin\webman\app\middleware\CheckAuth.php(27): Webman\App::Webman\{closure}(Object(support\Request))
#13 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(299): app\middleware\CheckAuth->process(Object(support\Request), Object(Closure))
#14 F:\admin\webman\app\middleware\CheckLogin.php(32): Webman\App::Webman\{closure}(Object(support\Request))
#15 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(299): app\middleware\CheckLogin->process(Object(support\Request), Object(Closure))
#16 F:\admin\webman\app\middleware\WebLog.php(22): Webman\App::Webman\{closure}(Object(support\Request))
#17 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(299): app\middleware\WebLog->process(Object(support\Request), Object(Closure))
#18 F:\admin\webman\vendor\webman-tech\debugbar\src\Middleware\DebugBarMiddleware.php(26): Webman\App::Webman\{closure}(Object(support\Request))
#19 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(299): WebmanTech\Debugbar\Middleware\DebugBarMiddleware->process(Object(support\Request), Object(Closure))
#20 F:\admin\webman\vendor\workerman\webman-framework\src\App.php(122): Webman\App::Webman\{closure}(Object(support\Request))
#21 F:\admin\webman\vendor\workerman\workerman\Connection\TcpConnection.php(638): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#22 F:\admin\webman\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #388)
#23 F:\admin\webman\vendor\workerman\workerman\Worker.php(2467): Workerman\Events\Select->loop()
#24 F:\admin\webman\vendor\workerman\workerman\Worker.php(1453): Workerman\Worker->run()
#25 F:\admin\webman\vendor\workerman\workerman\Worker.php(1396): Workerman\Worker::forkWorkersForWindows()
#26 F:\admin\webman\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#27 F:\admin\webman\vendor\workerman\webman-framework\src\support\App.php(124): Workerman\Worker::runAll()
#28 F:\admin\webman\start.php(4): support\App::run()
#29 {main}

截图报错信息里报错文件相关代码

配置信息

操作系统及workerman/webman等框架组件版本

版本

已解决
Redis::hDel("token_{$this->guard}",[$id]);
改成
Redis::hDel("token_{$this->guard}",$id);

1525 0 0
0个回答

年代过于久远,无法发表回答
×
🔝