Commit 09493ffe authored by 技术部-任文超's avatar 技术部-任文超

登录请求中:参数名openId被乱用,改为wechat_open_id,以是否存在该参数识别是否需要强制关联微信(会影响登录结果)

parent 27d358d3
......@@ -29,7 +29,7 @@ public interface Constants {
/** 登录账号/手机号参数名 */
String PHONE_NO = "phoneNo";
/** 微信标识参数名 */
String OPEN_ID = "openId";
String WECHAT_OPEN_ID = "wechat_open_id";
// -- Start -- IPV4安全策略常量组
/** 账密不匹配错误 - 按账号计数 */
......
......@@ -478,17 +478,17 @@ public class UserController implements IBaseController {
Objects.requireNonNull(request, "无效请求");
String clientIp = IPUtil.getRemoteIP(request);
Set<String> paramKeys = request.getParameterMap().keySet();
boolean ready = paramKeys.contains(Constants.OPEN_ID);
boolean ready = paramKeys.contains(Constants.WECHAT_OPEN_ID);
if(!ready){
return true;
}else if(Objects.isNull(user) || Objects.isNull(user.getId()) || StringUtils.isBlank(request.getParameter(Constants.OPEN_ID))){
}else if(Objects.isNull(user) || Objects.isNull(user.getId()) || StringUtils.isBlank(request.getParameter(Constants.WECHAT_OPEN_ID))){
LOGGER.warn("微信关联失败,user:{}, request-Header:{}",user, JSON.toJSONString(getRequestHeaderMap(request)));
return false;
}
Long userId = user.getId();
String phoneNo = user.getPhoneNo();
try{
int rows = wechatService.relateUser(userId, phoneNo, request.getParameter(Constants.OPEN_ID));
int rows = wechatService.relateUser(userId, phoneNo, request.getParameter(Constants.WECHAT_OPEN_ID));
return rows > 0;
}catch (Exception e){
LOGGER.error("微信关联失败,user:{}, request-Header:{}",user, JSON.toJSONString(getRequestHeaderMap(request)), e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment