码迷,mamicode.com
首页 > 微信 > 详细

asp源码微信公众号网页授权获取用户基本信息

时间:2018-10-12 13:55:58      阅读:390      评论:0      收藏:0      [点我收藏+]

标签:ppi   response   nothing   lse   tps   param   ediff   源码   分享   

Public Function Get_Access_Token()
sCode = Request("code")
If sCode ="" And Session("access_token")="" Then
Response.Redirect(GetAuthorization_Code)
Else
If DateDiff("s",Now,Session("access_token_expires"))> 0 Then
Exit Function
End If
End If
Dim url, params,Temp
Url="https://api.weixin.qq.com/sns/oauth2/access_token?"
params = "appid="&s_APPID
params = params & "&secret=" & s_APPSECRET
params = params & "&code=" & sCode
params = params & "&grant_type=authorization_code"
url = Url & params
Temp=RequestUrl(url,"GET","")
‘Die Temp
If CheckData(Temp,"access_token") = True Then
set obj = getjson(Temp)
if isobject(obj) Then
Session("access_token") = obj.access_token
Session("access_token_expires") = DateAdd("s",obj.expires_in,Now)
Session("openid") = obj.openid
End If
set obj = Nothing
Else
Response.Write("Get_Access_Token()=>"&Temp)
Response.End()
End If
End Function

=============================================

互相学习电话微信:18611436777(加微信注明事由)

技术分享图片

asp源码微信公众号网页授权获取用户基本信息

标签:ppi   response   nothing   lse   tps   param   ediff   源码   分享   

原文地址:https://www.cnblogs.com/lytocnc/p/9777301.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!