推送绑定逻辑 fix bug
This commit is contained in:
parent
240c5a5888
commit
826af239e6
@ -261,7 +261,7 @@ public class LoginController extends BaseControllerImpl {
|
||||
}
|
||||
|
||||
String cid = paramJSON.getStr("cid");
|
||||
String osType = paramJSON.getStr("osType");
|
||||
String osType = paramJSON.getStr("os_type");
|
||||
|
||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(userMobile, randKey, verifyCode, cid, osType);
|
||||
}
|
||||
@ -297,7 +297,7 @@ public class LoginController extends BaseControllerImpl {
|
||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"),
|
||||
paramJSON.getStr("rand_key"),
|
||||
paramJSON.getStr("verify_code"),
|
||||
paramJSON.getStr("cid"), paramJSON.getStr("osType"));
|
||||
paramJSON.getStr("cid"), paramJSON.getStr("os_type"));
|
||||
}
|
||||
|
||||
@ApiOperation("退出登录")
|
||||
|
||||
@ -151,7 +151,7 @@ public class AccountUserBaseController extends BaseControllerImpl {
|
||||
@RequestParam(name = "verify_code") String verificationCode,
|
||||
@RequestParam(name = "verify_token") String verify_token,
|
||||
@RequestParam(name = "cid", required = false) String cid,
|
||||
@RequestParam(name = "osType", required = false) String osType) {
|
||||
@RequestParam(name = "os_type", required = false) String osType) {
|
||||
if (StringUtils.isAnyBlank(user_account, user_password)) {
|
||||
return CommonResult.failed(I18nUtil._("用户名或密码不能为空!"));
|
||||
}
|
||||
@ -203,7 +203,7 @@ public class AccountUserBaseController extends BaseControllerImpl {
|
||||
|
||||
if (StrUtil.isNotBlank(cid)) {
|
||||
params.put("cid", cid); // 个推客户端Id
|
||||
params.put("osType", osType);// 个推客系统类别 1-Android;2-iOS;3-微信小程序;
|
||||
params.put("os_type", osType);// 个推客系统类别 1-Android;2-iOS;3-微信小程序;
|
||||
}
|
||||
|
||||
return accountUserBaseService.login(params);
|
||||
|
||||
@ -3132,7 +3132,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
params.put("verify_pwd", StrUtil.isBlank(password) ? "1001" : "1002"); // 是否验证密码 1001:不验证;1002:验证(内部登录没有用户明文密码,只能不验证)
|
||||
params.put("username", user_base_row.getUser_account());
|
||||
params.put("password", password);
|
||||
params.put("osType", getParameter("osType"));
|
||||
params.put("os_type", getParameter("os_type"));
|
||||
return login(params);
|
||||
} else {
|
||||
// 手机号码未绑定的情况, 直接抛出异常
|
||||
@ -3201,7 +3201,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
|
||||
if (StrUtil.isNotBlank(cid)) {
|
||||
params.put("cid", cid); // 个推客户端Id
|
||||
params.put("osType", osType);// 个推客系统类别 1-Android;2-iOS;3-微信小程序;
|
||||
params.put("os_type", osType);// 个推客系统类别 1-Android;2-iOS;3-微信小程序;
|
||||
// logger.info("推送参数2 cid:{}, osType:{}", cid, osType);
|
||||
}
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@ -30,24 +31,23 @@ public class AccountUserBindGeTuiServiceImpl extends BaseServiceImpl<UserDeviceB
|
||||
// 检查参数是否有效
|
||||
if (ObjectUtil.isNull(accountUserBindGeTui) ||
|
||||
StrUtil.isBlank(accountUserBindGeTui.getCid()) ||
|
||||
CheckUtil.isEmpty(accountUserBindGeTui.getUserId())
|
||||
|| CheckUtil.isEmpty(accountUserBindGeTui.getUserType())) {
|
||||
log.error("缺少必要参数:cid={}, userId={}, userType={}",
|
||||
CheckUtil.isEmpty(accountUserBindGeTui.getUserId())) {
|
||||
log.error("缺少必要参数:cid={}, userId={}",
|
||||
accountUserBindGeTui != null ? accountUserBindGeTui.getCid() : null,
|
||||
accountUserBindGeTui != null ? accountUserBindGeTui.getUserId() : null,
|
||||
accountUserBindGeTui != null ? accountUserBindGeTui.getUserType() : null);
|
||||
accountUserBindGeTui != null ? accountUserBindGeTui.getUserId() : null);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取操作系统类型,默认为1 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||
Integer osType = accountUserBindGeTui.getOsType() != null ? accountUserBindGeTui.getOsType() : 1;
|
||||
Integer userType = accountUserBindGeTui.getUserType() != null ? accountUserBindGeTui.getOsType() : CommonConstant.USER_TYPE_MCH;
|
||||
|
||||
// 构建查询条件 组合健:用户ID、CID、用户类型、手机系统类型 (同一个账号同一个系统需要同时收到推送,所以增加了 cid 条件)
|
||||
QueryWrapper<AccountUserBindGeTui> wrapper = new QueryWrapper<AccountUserBindGeTui>()
|
||||
.eq("user_id", accountUserBindGeTui.getUserId())
|
||||
.eq("cid", accountUserBindGeTui.getCid())
|
||||
.eq("os_type", osType)
|
||||
.eq("user_type", accountUserBindGeTui.getUserType())
|
||||
.eq("user_type", userType)
|
||||
.eq("status", CommonConstant.Enable)
|
||||
.orderByDesc("id");
|
||||
|
||||
@ -59,6 +59,7 @@ public class AccountUserBindGeTuiServiceImpl extends BaseServiceImpl<UserDeviceB
|
||||
|
||||
// 更新记录
|
||||
accountUserBindGeTui.setId(existAccountUserBindGeTui.getId());
|
||||
accountUserBindGeTui.setUpdatedAt(new Date());
|
||||
return this.updateById(accountUserBindGeTui);
|
||||
} catch (Exception e) {
|
||||
// 捕获异常并记录错误日志
|
||||
|
||||
Loading…
Reference in New Issue
Block a user