我自己加上的,理解错了。下面代码这样写可以获取到mobile手机号吗?想通过手机号验证。
If e.GetValues.ContainsKey("code") Then '如果通过授权链接跳转而来,就根据传递过来的code参数调用接口,获取用户的UserId
Dim ul As String = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={0}&code={1}"
ul = CExp(ul,Functions.Execute("GetQYAccessToken"),e.GetValues("code"))
Dim hc As new HttpClient(ul)
Dim jo As JObject = JObject.Parse(hc.GetData)
'If jo("UserId") IsNot Nothing Then
If jo("mobile") IsNot Nothing Then
'UserId = jo("UserId")
mobile = jo("mobile")
End If
Else
'UserId = e.Cookies("uid")
mobile = e.Cookies("mobile")
End If