(已解决)CMS更新用户信息失败
1. 运行环境#
lnmp
1). 当前使用的 Laravel 版本?#
laravel 8
2). 当前使用的 php/php-fpm 版本?#
PHP 版本:7.4
3). 当前系统#
Ubuntu 20.4
4). 业务环境#
开发环境
2. 问题描述?#
客户端代码:
public function casLogin(Request $request)
{
$cas = app('cas');
$url = env('CAS_LOGIN_URL');
try {
if ($cas->checkAuthentication()) {
$cas_user = $cas->getAttributes();
$uid = $cas_user['uid'];
$url = '登录逻辑';
}
return redirect()->to($url);
} catch (\Exception $e) {
Log::debug($e->getMessage());
return redirect()->to(env('CAS_SYSTEM_LOGIN'));
}
}
当前问题是 $cas->getAttributes () 获取不到最新用户的信息,A 用户登录,跳转到业务系统获取到 A 用户信息,当服务端切换 B 用户登录,在客户端 $cas->getAttributes () 获取到的还是 A 用户的信息,$cas->renewAuthentication () 也试过了,依然解决不了问题
3. 您期望得到的结果?#
能够同步用户信息
推荐文章: