渤海易贷随机生成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.open.WeChatAuthServiceImpl;
|
||||||
import com.fangjia.service.util.CookieUtils;
|
import com.fangjia.service.util.CookieUtils;
|
||||||
|
|
||||||
|
import com.fangjia.service.util.DataConvertUtil;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
import com.fangjia.core.util.CacheUtils;
|
import com.fangjia.core.util.CacheUtils;
|
||||||
@@ -77,13 +78,14 @@ public class UserController {
|
|||||||
} else {
|
} else {
|
||||||
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
||||||
}
|
}
|
||||||
if(weiXinId == null) {
|
if(weiXinId == null && StringUtils.isNotBlank(model.getCode())) {//微信公众号渤海银行
|
||||||
weiXinId = CookieUtils.getCookieValue(request,"we_chat_open_id");
|
weiXinId = DataConvertUtil.getRandomString2(16);
|
||||||
}
|
}
|
||||||
if(weiXinId != null && !weiXinId.equals("")){
|
if(weiXinId != null && !weiXinId.equals("")){
|
||||||
CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response);
|
CookieUtils.setCookie("we_chat_open_id", weiXinId, "/", 60 * 60 * 24 *7, response);
|
||||||
}
|
}
|
||||||
System.out.println("bhyd微信OPEN_ID:" + weiXinId);
|
System.out.println("bhyd微信OPEN_ID:" + weiXinId);
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user