redirect_uri 參數(shù)錯(cuò)誤 回調(diào)域 外網(wǎng)可以訪問(wèn)的
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String backUrl = "17pa992873.51mypc.cn/OF365ChairsChair/callBack";
String url = "https://open.weixin.qq.com/connect/qrconnect?appid="+Auth.APPID
+ "&redirect_uri="+URLEncoder.encode(backUrl)
+ "&response_type=code"
+ "&scope=snsapi_login"
+ "&state=STATE#wechat_redirect";
// String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+Auth.APPID
// + "&redirect_uri="+URLEncoder.encode(backUrl)
// + "&response_type=code"
// + "&scope=snsapi_userinfo"
// + "&state=STATE#wechat_redirect";
resp.sendRedirect(url);
}
-------------------------------------------------------------------------------------------------
2017-09-10
按照文檔上得來(lái),慢慢檢錯(cuò)