检测用户信息

@param  userId:用户 Id。（必传）

@return $json
324857
public function userinfo($userid){
       try{
           if (empty($userId))
               throw new Exception('Paramer "userId" is required');

           $params = array (
               'userId' => $userId,
           );

           $ret = $this->SendRequest->curl('/user/info.json',$params,'urlencoded','im','POST');
           if(empty($ret))
               throw new Exception('bad request');
           return $ret;

       }catch (Exception $e) {
           print_r($e->getMessage());
       }
   }
1351265
public function userBlacklistQuery($userId) {
        try{
            if(empty($userId))
                throw new Exception('用户 Id 不能为空');
            $ret = $this->curl('/user/blacklist/query', array('userId' => $userId));
            if(empty($ret))
                throw new Exception('请求失败');
            return $ret;
        }catch (Exception $e) {
            print_r($e->getMessage());
        }
    }
779072
public static function getAllMenuIdArrByUserId($userId)
    {
        $data = static::find()
            ->findByUserId($userId)
            ->asArray()
            ->all();

        $menuIdArr = [];
        foreach ($data as $item) {
            $menu = DpAdminMenu::find()
                ->findByMenuId($item['menu_id'])
                ->asArray()
                ->one();
            if ($menu) {
                $menuIdArr[] = $item['menu_id'];
            }
        }

        return $menuIdArr;
    }
841112
def user_data(self, access_token, *args, **kwargs):
        """"""

        return self.get_json(self.USER_INFO_URL, method="POST", headers=self._get_headers(access_token))
499949
public static function findProviderDataByUserId($userId, $provider)
    {
        $weChat = static::findOne(['user_id' => $userId, 'provider' => $provider]);
        if ($weChat) {
            return $weChat->getDecodedData();
        }
        return null;
    }
152356
public function assignUser($userGroupId, $userId = [])
    {
        $this->groupId = $userGroupId;

        $this->getLogger()->info('Assigning User IDs ' . json_encode($userId) . ' To User Group ID ' . $this->groupId);
        $response = $this->doPost('/group/members/assign/' . $userGroupId, [
            'userId' => $userId
        ]);

        /** @var XiboUserGroup $userGroup */
        $userGroup = $this->hydrate($response);

        return $userGroup;
    }
834056
public function getUser($userId)
    {
        // Make sure users have been 'got' already.
        $this->getUsers();

        // In most cases by far, we'll request an ID, and we can return it here.
        if ($userId && array_key_exists($userId, $this->users)) {
            return $this->users[$userId];
        }

        // Fallback: See if we can get it by username or email address.
        try {
            if ($userEntity = $this->getRepository()->getUser($userId)) {
                return $userEntity->toArray();
            }
        } catch (TableNotFoundException $e) {
            return false;
        }

        return false;
    }
796231
public Optional<User> show(long userId)
    {
        return HTTP.GET(String.format("/v2/users/%d.json", userId), USER);
    }
437438
static function fetchListForUser( $userID )
    {
        return eZPersistentObject::fetchObjectList( eZContentBrowseRecent::definition(),
                                                    null, array( 'user_id' => $userID ),
                                                    array( 'created' => 'desc' ), null, true );
    }
812272
public function show($id)
    {
        // get user by id
        $user = AppUser::find($id);

        if (!$user) {
            return response()->json(null, 404);
        }

        return response()->json(arrayView('phpsoft.users::user/read', [
            'user' => $user
        ]), 200);
    }
31832
def get_infos_with_id(self, uid):
        

        _logid = uid
        _user_info_url = USER_INFO_URL.format(logid=_logid)
        return self._request_api(url=_user_info_url).json()
626223
public function getUserOptions(string $id, string $userID): ?array
    {
        $data = Internal\Data::getValue('.temp/bearcms/userthemeoptions/' . md5($userID) . '/' . md5($id) . '.json');
        if ($data !== null) {
            $data = json_decode($data, true);
            if (isset($data['options'])) {
                return $data['options'];
            }
        }
        return null;
    }
380076
public function getUser($id)
    {
        $request = $this->client->get($this->customer['url'].'/api/users/'.$id);

        $request->setAuth($this->customer['username'], $this->customer['password']);
        $response = $request->send();

        return json_decode((string) $response->getBody(true));
    }
621440
public function tryMatch(string $userOpenID)
    {
        $url = $this->getUrl('trymatch');
        $data = ['user_id' => $userOpenID];
        $request = urlencode(json_encode($data));
        $json = $this->curl->post($url, $request);

        return $json;
    }
304794
public function userShow($user_id)
    {
        $response = $this->getGuzzleClient()
            ->get('/users/' . $user_id, $this->setQuery());

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            User::class,
            'json'
        );
    }
959459
protected function getUser($userId = null)
    {
        if ($userId === null) {
            /** @var Token $sessionAuth */
            if ($this->session()->isStarted() && $sessionAuth = $this->session()->get('authentication')) {
                return $sessionAuth->getUser();
            }

            return false;
        }
        /** @var Repository\UsersRepository $repo */
        $repo = $this->storage()->getRepository(Entity\Users::class);

        return $repo->getUser($userId);
    }
532489
public function getUserInfo($openId)
    {
        return $this->auth(function () use ($openId) {
            // 1. 调用接口,获取用户信息
            $userInfo = $this->http([
                'url' => 'https://api.weixin.qq.com/cgi-bin/user/info',
                'data' => [
                    'access_token' => $this->accessToken,
                    'openid' => $openId,
                    'lang' => 'zh_CN',
                ],
            ]);

            // 2. 处理微信可能返回错误JSON的情况
            $responseText = $userInfo->getResponseText();
            $response = json_decode($responseText, true);

            // 有的用户会返回错误的JSON格式,导致PHP出现JSON_ERROR_CTRL_CHAR错误
            // {"subscribe":1,"openid":"o0Mh3tzELt7MrnjqRlzNJ9SXNgMg","nickname":"dyx","sex":2,"language":"zh_CN","city":"bý","province":"VÛ]Ý","country":"","headimgurl":"http:\/\/wx.qlogo.cn\/mmopen\/4ibDOGnEicR5lJbicvZOD5Lonvu3kMYphDMJByD9UYCMOzCXwdVxzDpvnlhJJqjDichASpHUYjd51lLNXicoPdib6ibNnxpsUbFgPN3\/0","subscribe_time":1391064765}
            if ($response === null && json_last_error() !== JSON_ERROR_NONE) {
                // 删除返回数据中的错误控制符
                $responseText = preg_replace('/[\x00-\x1F\x7F]/', '', $responseText);
                $response = json_decode($responseText, true);
            }

            // 3. 如果仍然解析不出来,确实是数据错误
            if ($response === null) {
                throw new \Exception('返回不是有效的JSON数据,数据是' . $userInfo->getResponseText(), -1);
            }

            // 4. 将解析成功的数据,设置回去
            $userInfo->setOption('response', $response);

            return $userInfo;
        });
    }