src/thinkextend/oauth/driver/Taobao.php
public function getOauthInfo()
    {
        $fields = 'user_id,nick,sex,buyer_credit,avatar,has_shop,vip_info';
        $data   = $this->call('taobao.user.buyer.get', "fields={$fields}");

        if (!empty($data['user_buyer_get_response']['user'])) {
            $user               = $data['user_buyer_get_response']['user'];
            $userInfo['type']   = 'TAOBAO';
            $userInfo['name']   = $user['user_id'];
            $userInfo['nick']   = $user['nick'];
            $userInfo['avatar'] = $user['avatar'];
            return $userInfo;
        } else {
            E("获取淘宝网用户信息失败：{$data['error_response']['msg']}");
        }
    }
public function getOauthInfo()
    {
        $fields = 'user_id,nick,sex,buyer_credit,avatar,has_shop,vip_info';
        $data   = $this->call('taobao.user.buyer.get', "fields={$fields}");

        if (!empty($data['user_buyer_get_response']['user'])) {
            $user               = $data['user_buyer_get_response']['user'];
            $userInfo['type']   = 'TAOBAO';
            $userInfo['name']   = $user['user_id'];
            $userInfo['nick']   = $user['nick'];
            $userInfo['avatar'] = $user['avatar'];
            return $userInfo;
        } else {
            E("获取淘宝网用户信息失败：{$data['error_response']['msg']}");
        }
    }
public function getOauthInfo ( ) { $ fields = 'user_id,nick,sex,buyer_credit,avatar,has_shop,vip_info' ; $ data = $ this -> call ( 'taobao.user.buyer.get' , "fields={$fields}" ) ; if ( ! empty ( $ data [ 'user_buyer_get_response' ] [ 'user' ] ) ) { $ user = $ data [ 'user_buyer_get_response' ] [ 'user' ] ; $ userInfo [ 'type' ] = 'TAOBAO' ; $ userInfo [ 'name' ] = $ user [ 'user_id' ] ; $ userInfo [ 'nick' ] = $ user [ 'nick' ] ; $ userInfo [ 'avatar' ] = $ user [ 'avatar' ] ; return $ userInfo ; } else { E ( "获取淘宝网用户信息失败：{$data['error_response']['msg']}"); } }
获取当前登录的用户信息
@return array
获取当前登录的用户信息