From 5e22d423d4add1ac5e0bfc8b67e7eba4843a1fea Mon Sep 17 00:00:00 2001 From: gr Date: Fri, 28 Aug 2026 14:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/api/controller/DesktopController.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 server/app/api/controller/DesktopController.php diff --git a/server/app/api/controller/DesktopController.php b/server/app/api/controller/DesktopController.php new file mode 100644 index 000000000..fc7ca37ad --- /dev/null +++ b/server/app/api/controller/DesktopController.php @@ -0,0 +1,44 @@ +userInfo['terminal'] ?? 0) !== UserTerminalEnum::WECOM_RPA) { + return $this->fail('当前登录令牌不属于企业微信客服桌面端'); + } + + $user = User::where(['id' => $this->userId]) + ->field('id,sn,nickname,mobile,avatar,is_disable') + ->findOrEmpty(); + if ($user->isEmpty() || (int)$user['is_disable'] === YesNoEnum::YES) { + return $this->fail('用户不存在或已禁用'); + } + + return $this->data([ + 'user_id' => (int)$user['id'], + 'sn' => (string)$user['sn'], + 'nickname' => (string)$user['nickname'], + 'mobile' => (string)$user['mobile'], + 'avatar' => (string)$user['avatar'], + 'terminal' => UserTerminalEnum::WECOM_RPA, + 'expire_time' => (int)($this->userInfo['expire_time'] ?? 0), + 'status' => 'active', + ]); + } +}