临时处理仪表盘显示
This commit is contained in:
@@ -172,7 +172,7 @@ class AuthLogic
|
|||||||
$payload = $this->buildJwtPayload($user, $system);
|
$payload = $this->buildJwtPayload($user, $system);
|
||||||
$token = $this->generateAccessToken($payload);
|
$token = $this->generateAccessToken($payload);
|
||||||
$refreshToken = $this->generateRefreshToken($user->id, $data['system_code']);
|
$refreshToken = $this->generateRefreshToken($user->id, $data['system_code']);
|
||||||
$homeUrl = $this->getHome($system->id);
|
$homeUrl = $this->getHome($system->id, $payload);
|
||||||
|
|
||||||
// 记录 token 到 Redis 和 MySQL
|
// 记录 token 到 Redis 和 MySQL
|
||||||
$this->recordUserToken($user->id, $token, $data['system_code']);
|
$this->recordUserToken($user->id, $token, $data['system_code']);
|
||||||
@@ -537,8 +537,22 @@ class AuthLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getHome($systemId)
|
public function getHome($systemId, $data)
|
||||||
{
|
{
|
||||||
|
// 2025.10.30 临时处理 ====== start
|
||||||
|
if ($systemId == 1) {
|
||||||
|
if (in_array(1, $data['role_ids'])) {
|
||||||
|
return '/dashboard/console';
|
||||||
|
}
|
||||||
|
if (count($data['role_ids']) == 1 && in_array(5, $data['role_ids'])) {
|
||||||
|
return '/dashboard/console/backoffice';
|
||||||
|
}
|
||||||
|
if (count($data['role_ids']) == 1 && in_array(6, $data['role_ids'])) {
|
||||||
|
return '/dashboard/console/finance';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 2025.10.30 临时处理 ====== end
|
||||||
|
|
||||||
$info = Resource::where('system_id', $systemId)
|
$info = Resource::where('system_id', $systemId)
|
||||||
->where('is_home', 1)
|
->where('is_home', 1)
|
||||||
->first();
|
->first();
|
||||||
|
|||||||
Reference in New Issue
Block a user