渤海银行微信公众号验证

This commit is contained in:
2021-08-27 18:32:23 +08:00
parent 485ede8dbd
commit 914254cccc
@@ -63,7 +63,27 @@ public class UserController {
return model;
}
public Object bhydLoginPageAction(UserModel model) {
public Object bhydLoginPageAction(UserModel model, HttpServletResponse response, HttpServletRequest request) {
String type = StringUtils.trimToNull(model.getType());
if(!StringUtils.isBlank(type)){
model.setType(type);
CookieUtils.setCookie("login_user_type", type, "/", 60 * 60 * 24 *7, response);
}
WeChatAuthServiceImpl.WeChatWebToken token = weChatAuthService.getWeChatWebToken(model.getCode());
String weiXinId = "";
if(token != null) {
weiXinId = token.getOpenid();
} else {
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
}
if(weiXinId == null) {
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
}
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;
}