Skip to content

微信获取用户信息,接口提供给没有服务号的用户使用,或者个人使用;

Notifications You must be signed in to change notification settings

leiroc/cross-wxauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

cross-wxauth

微信获取用户信息,接口提供给没有服务号的用户使用,或者个人使用;

##官方微信授权步骤

  • 第一步:用户同意授权,获取code

  • 第二步:通过code换取网页授权access_token

  • 第三步:刷新access_token(如果需要)

  • 第四步:拉取用户信息(需scope为 snsapi_userinfo)

##使用方法

例如:在 A: http://xx.cn/xxx/index.html 域名下获得微信用户的信息


	var code = getQueryString('code');
	
	if (code) {
	    Ajax({
	        type: 'get',
	        url: 'http://api.wbh5.com/cross/wxusers?callback=?',
	        data: {code: code}
	    }, function (data) {
	        alert(JSON.stringify(data));
	    })
	
	}

About

微信获取用户信息,接口提供给没有服务号的用户使用,或者个人使用;

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published