Build Status Total Downloads Latest Stable Version License

微信

1.微信登录


  • 参数

    参数 说明 示例
    url 授权成功后回调网页地址,必须对其进行base64编码 location.href
    scope 授权类型 base:只获取id,userinfo:获取详细信息
  • 请求

1
2
3
4
const oauthUrl = "http://login.wesdata.cn/web/login/wechat"
const callback = "http://www.abc.com/path/page"
const url = oauthUrl + '?url=' + btoa(callback) + 'scope=userinfo'
location.href = url
  • 返回
1
http://www.abc.com/path/page?appId=xx1&appName=xx2&appHead=xx3

2.JSSDK配置


  • 请求
1
2
3
const oauthUrl = "http://login.wesdata.cn/web/wechat/js-sdk-config"
const shareUrl = btoa(location.href)
http.get(oauthUrl + '?url=' + shareUrl)
  • 返回
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"code": 200,
"message": "success",
"data": {
"debug": false,
"beta": false,
"jsApiList": [
"updateAppMessageShareData",
"updateTimelineShareData"
],
"openTagList": [],
"appId": "wxe43539aedf49b63a",
"nonceStr": "GVSMGAIz8t",
"timestamp": 1654101630,
"url": "http://login.wesdata.cn",
"signature": "de8da90cb1de83de369bcd9a9de302b8a18c428a"
}
}