status != 1) { throw new BusinessException('账号已禁用', 403); } return $user; } /** * 用户信息 */ public function edit(int $uid, array $data) { $user = User::find($uid); if (!$user) { throw new BusinessException('账户不存在', 404); } $user->fill($data); $user->save(); return $user; } }