api('oauth2/get_token_info', 'POST'); $result = $this->api("2/users/show.json", 'GET', [ 'uid' => $attributes['uid'] ]); $result['login'] = $result['name']; $result['email'] = $result['name'] . '@weibo.com'; $result['avatar'] = $result['avatar_large']; return $result; } /** * @inheritdoc */ public function getEmail() { return isset($this->getUserAttributes()['email']) ? $this->getUserAttributes()['email'] : null; } /** * @inheritdoc */ public function getUsername() { return isset($this->getUserAttributes()['name']) ? $this->getUserAttributes()['name'] : null; } protected function defaultName() { return 'weibo'; } protected function defaultTitle() { return '微博'; } }