From 0e32955b2cd8d7f021dea7a274eebcdda55df505 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Sat, 28 Aug 2021 15:57:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=A4=E6=B5=B7=E6=98=93=E8=B4=B7=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA=E7=94=9F=E6=88=90openid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/open/controllers/weixin/UserController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java index a2d15d3e4..d40136cb2 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/UserController.java @@ -17,6 +17,7 @@ import com.fangjia.service.open.WeChatAuthService; import com.fangjia.service.open.WeChatAuthServiceImpl; import com.fangjia.service.util.CookieUtils; +import com.fangjia.service.util.DataConvertUtil; import org.apache.commons.lang.StringUtils; import com.fangjia.core.util.CacheUtils; @@ -77,13 +78,14 @@ public class UserController { } else { weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id"); } - if(weiXinId == null) { - weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id"); + if(weiXinId == null && StringUtils.isNotBlank(model.getCode())) {//微信公众号渤海银行 + weiXinId = DataConvertUtil.getRandomString2(16); } if(weiXinId != null && !weiXinId.equals("")){ CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response); } System.out.println("bhyd微信OPEN_ID:" + weiXinId); + return model; }