Skip to content

新浪微博登录报错 #4

@mingge2016

Description

@mingge2016

/** * 获取用户信息 * @return array||bool * @throws \Exception */ public function getUserInfo(){ $params['uid'] = $this->openid(); $response = $this->call('users/show',$params); if ($response['ret'] == 0) { $userInfo['openid'] = $this->openid(); $userInfo['username'] = $response['screen_name']; $userInfo['avatar'] = $response['profile_image_url']; $userInfo['sex'] = $response['gender']=='m'?1:2; return $userInfo; } else { return false; } }

if ($response['ret'] == 0) {
应该改为:
if ($response['error_code'] == 0) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions