渤海易贷随机生成openid
This commit is contained in:
+4
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user