- <%@ page language="java" import="base.SsC" pageEncoding="UTF-8"%>
- <%@ page import="base.WechatC" %>
- <html>
- <head>
- </head>
- <body>
- <script>
- //下面url是发起授权的url,其中参数scope是是否需要用户授权确认的意思,有两个选项,scope=snsapi_base表示静默,scope=snsapi_userinfo表示弹出让用户授权的窗口
- //下面的redirect_uri就是,浏览器跳到下面url地址的微信页面后,浏览器会重定向(跳到)的新地址
- window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+ <%=WechatC.WECHAT_appId%> +
- "&redirect_uri=http://localhost:8080/extRoot?type=${type}&token=${token}"+ <%-- 这里的 &token= 就是 token,不是 &ssToken=。Lin --%>
- "&response_type=code&scope=snsapi_base&state=123#wechat_redirect";
- </script>
- </body>
- </html>
|