imsun / gitment

A comment system based on GitHub Issues.
https://imsun.github.io/gitment/
MIT License
4.06k stars 350 forks source link

如何获取登录的访客信息 #17

Closed shenweiyan closed 7 years ago

shenweiyan commented 7 years ago

登录或者留言的用户头像这些信息能获取到么?

imsun commented 7 years ago

gitment.state.user 为登录用户信息,数据格式与见 https://developer.github.com/v3/users/#get-a-single-user

未登录时为空对象。

也可以自己获取:

gitment.loadUserInfo()
  .then(user => console.log(user))