MCPcopy Create free account
hub / github.com/TruthHun/BookStack / GetQQUserInfo

Function GetQQUserInfo

oauth/qq.go:108–122  ·  view source on GitHub ↗

获取用户信息

(accessToken, openid string)

Source from the content-addressed store, hash-verified

106
107//获取用户信息
108func GetQQUserInfo(accessToken, openid string) (info QQUser, err error) {
109 var resp string
110 Api := beego.AppConfig.String("oauth::qqUserInfo") + "?oauth_consumer_key=" + beego.AppConfig.String("oauth::qqClientId") + "&access_token=" + accessToken + "&openid=" + openid
111 req := httplib.Get(Api)
112 if strings.HasPrefix(Api, "https") {
113 req.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
114 }
115 if resp, err = req.String(); err == nil {
116 if debug {
117 beego.Debug("获取QQ登录的用户信息", resp, Api)
118 }
119 err = json.Unmarshal([]byte(resp), &info)
120 }
121 return
122}

Callers 1

OauthMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected