赞
踩
springcloud项目实战之netty-websocket配置微信扫码鉴权登录
@Bean public WxMpMessageRouter messageRouter(WxMpService wxMpService) { final WxMpMessageRouter newRouter = new WxMpMessageRouter(wxMpService); // 记录所有事件的日志 (异步执行) newRouter.rule().handler(this.logHandler).next(); // 关注事件 newRouter.rule().async(false).msgType(EVENT).event(SUBSCRIBE). handler(this.subscribeHandler).end(); // 扫码事件 newRouter.rule().async(false).msgType(EVENT).event(EventType.SCAN). handler(this.scanHandler).end(); // 默认 newRouter.rule().async(false).handler(this.msgHandler).end(); return newRouter; }
String repUrl = callback + "/wx/portal/public/callBack";
String authorizeUrl = String.format(weiXinAuthorUrl, wxMpService.getWxMpConfigStorage().getAppId(),
URLEncoder.encode(repUrl));
String login_a_href = "<a href=\"" + authorizeUrl + "\">登录</a>";
return TextBuilderAdapter.build("请点击登录: "+login_a_href,wxMpXmlMessage);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。