From bcae1cd06e980fea3b34b9a03ea2a3604dad44a6 Mon Sep 17 00:00:00 2001 From: GiveMePast <1248298477@qq.com> Date: Wed, 27 May 2026 10:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/AuthService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/common/service/AuthService.php b/app/common/service/AuthService.php index 18bd665..81ec18a 100644 --- a/app/common/service/AuthService.php +++ b/app/common/service/AuthService.php @@ -14,8 +14,8 @@ class AuthService public function login(string $username, string $password) { $user = User::with(['company']) - ->where('username', $username) - ->find(); + ->where('username', $username) + ->find(); @@ -29,6 +29,7 @@ class AuthService $userInfo = [ + 'id' => $user['id'], // 用户ID 'company_name' => $user['company']['company_name'], // 所属公司名称 'username' => $user['username'], 'role' => $user['role'], @@ -37,6 +38,5 @@ class AuthService Session::set('user_info', $user); return $userInfo; - } }