1 Star 3 Fork 1

潇辰风 / thirdparty

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 470 Bytes
一键复制 编辑 原始数据 按行查看 历史
龙龙 提交于 2022-11-02 16:50 . 修改仓库从github 到gitee
package main
import (
"fmt"
"log"
"gitee.com/cf-soft/thirdparty/oauth"
)
func main() {
wxConf := &oauth.AuthConfig{ClientId: "xxx", ClientSecret: "xxx", RedirectUrl: "http://www.cfsoft.cn"}
wxAuth := oauth.NewAuthWxWechat(wxConf)
fmt.Print(wxAuth.GetRedirectUrl("sate")) //获取第三方登录地址
wxRes, err := wxAuth.GetWebAccessToken("code")
userInfo, _ := wxAuth.GetUserInfo(wxRes.AccessToken, wxRes.OpenId)
log.Println("ssss:", err, userInfo)
}
Go
1
https://gitee.com/cf-soft/thirdparty.git
git@gitee.com:cf-soft/thirdparty.git
cf-soft
thirdparty
thirdparty
main

搜索帮助