fix: bilibili name and avatar (#772)

Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com>
This commit is contained in:
Yixiang Zhao
2022-05-31 21:54:00 +08:00
committed by GitHub
parent f7705931f7
commit e78ea2546f
2 changed files with 5 additions and 4 deletions

View File

@ -187,9 +187,10 @@ func (idp *BilibiliIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, erro
} }
userInfo := &UserInfo{ userInfo := &UserInfo{
Id: bUserInfoResponse.Data.OpenId, Id: bUserInfoResponse.Data.OpenId,
Username: bUserInfoResponse.Data.Name, Username: bUserInfoResponse.Data.Name,
AvatarUrl: bUserInfoResponse.Data.Face, DisplayName: bUserInfoResponse.Data.Name,
AvatarUrl: bUserInfoResponse.Data.Face,
} }
return userInfo, nil return userInfo, nil

View File

@ -142,7 +142,7 @@ class OAuthWidget extends React.Component {
</span> </span>
</Col> </Col>
<Col span={24 - this.props.labelSpan} > <Col span={24 - this.props.labelSpan} >
<img style={{marginRight: '10px'}} width={30} height={30} src={avatarUrl} alt={name} /> <img style={{marginRight: '10px'}} width={30} height={30} src={avatarUrl} alt={name} referrerPolicy="no-referrer" />
<span style={{width: this.props.labelSpan === 3 ? '300px' : '130px', display: (Setting.isMobile()) ? 'inline' : "inline-block"}}> <span style={{width: this.props.labelSpan === 3 ? '300px' : '130px', display: (Setting.isMobile()) ? 'inline' : "inline-block"}}>
{ {
linkedValue === "" ? ( linkedValue === "" ? (