diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WechatLoginController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WechatLoginController.java index 98c3e2be9..0f1a52012 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WechatLoginController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WechatLoginController.java @@ -167,7 +167,7 @@ public class WechatLoginController extends BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "key", value = "key", dataType = "String", paramType = "query", required = true), @ApiImplicitParam(name = "userName", value = "userName", dataType = "String", paramType = "query", required = true)}) - public void weChatUserLogin(String userName, String key, HttpServletRequest request, HttpServletResponse response) { + public ResultData weChatUserLogin(String userName, String key, HttpServletRequest request, HttpServletResponse response) { log.debug("[" + getIpAddr() + "] MallUserInfoController::weChatUserLogin"); String host = request.getHeader("host"); log.debug("Host: " + host); @@ -199,22 +199,17 @@ public class WechatLoginController extends BaseController { unameCookie.setMaxAge(60); response.addCookie(unameCookie); - log.debug("https://" + host + "/#/"); - response.sendRedirect("https://" + host + "/#/layout"); + return new ResultData(); } catch (Exception e) { log.error(e.getMessage()); } } else { // 登录失败 log.error("微信登录失败,未找到对应的openId"); + return new ResultData(ErrorCode.WECHAT_LOGIN_KEY_OVERTIME); } } - // 未找到/登录失败,跳转登录页 - try { - response.sendRedirect("https://" + host + "/#/login?type=WECHAT"); - }catch (Exception e) { - log.error(e.getMessage()); - } + return new ResultData(ErrorCode.WECHAT_LOGIN_KEY_OVERTIME); } @ApiOperation(value = "微信第三方登录绑定", notes = "请配置此callback到网页redirect_uri")