@WebServlet("/wxLogin")
public class WXLoginServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String backUrl = "http://morning.iok.la/MEILI/callBack";// 回调地址
String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+ AuthUtils.APPID
+ "&redirect_uri="
+ URLEncoder.encode(backUrl)
+ "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
resp.sendRedirect(url);
}
添加回答
举报
0/150
提交
取消