mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
fix: WeComInternalIdProvider GetUserInfo method could not get the correct user id (#616)
This commit is contained in:
@ -111,6 +111,7 @@ type WecomInternalUserInfo struct {
|
|||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar"`
|
||||||
OpenId string `json:"open_userid"`
|
OpenId string `json:"open_userid"`
|
||||||
|
UserId string `json:"userid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (idp *WeComInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) {
|
func (idp *WeComInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) {
|
||||||
@ -156,7 +157,7 @@ func (idp *WeComInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo,
|
|||||||
return nil, fmt.Errorf("userInfoResp.errcode = %d, userInfoResp.errmsg = %s", infoResp.Errcode, infoResp.Errmsg)
|
return nil, fmt.Errorf("userInfoResp.errcode = %d, userInfoResp.errmsg = %s", infoResp.Errcode, infoResp.Errmsg)
|
||||||
}
|
}
|
||||||
userInfo := UserInfo{
|
userInfo := UserInfo{
|
||||||
Id: infoResp.OpenId,
|
Id: infoResp.UserId,
|
||||||
Username: infoResp.Name,
|
Username: infoResp.Name,
|
||||||
DisplayName: infoResp.Name,
|
DisplayName: infoResp.Name,
|
||||||
Email: infoResp.Email,
|
Email: infoResp.Email,
|
||||||
|
Reference in New Issue
Block a user