无修改

This commit is contained in:
2026-05-27 10:38:51 +08:00
parent d332721f5c
commit bcae1cd06e

View File

@@ -14,8 +14,8 @@ class AuthService
public function login(string $username, string $password) public function login(string $username, string $password)
{ {
$user = User::with(['company']) $user = User::with(['company'])
->where('username', $username) ->where('username', $username)
->find(); ->find();
@@ -29,6 +29,7 @@ class AuthService
$userInfo = [ $userInfo = [
'id' => $user['id'], // 用户ID
'company_name' => $user['company']['company_name'], // 所属公司名称 'company_name' => $user['company']['company_name'], // 所属公司名称
'username' => $user['username'], 'username' => $user['username'],
'role' => $user['role'], 'role' => $user['role'],
@@ -37,6 +38,5 @@ class AuthService
Session::set('user_info', $user); Session::set('user_info', $user);
return $userInfo; return $userInfo;
} }
} }