1、你并没有把openid返回,你函数return的都是空值,你要写
return OpenId 才行。
2、你要访问的应该是这样地址
https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
而不是直接访问 hello.htm 这个地址。