实名认证接口修改
This commit is contained in:
@@ -113,15 +113,15 @@ public class AppController {
|
||||
if (count > 0) {
|
||||
errMsg = "支付宝信息修改失败: 一个支付宝账号仅可绑定一个用户";
|
||||
}
|
||||
if (StrUtil.isNotBlank(userInfo.getCertName()) && !certName.equals(userInfo.getCertName())) {
|
||||
if (errMsg == null && StrUtil.isNotBlank(userInfo.getCertName()) && !certName.equals(userInfo.getCertName())) {
|
||||
errMsg = "支付宝信息修改失败: 姓名与实名认证信息不相符";
|
||||
}
|
||||
|
||||
if (!DataLimitUtil.isAccessAllowed(zhiFuBao+certName, Integer.parseInt(commonRepository.findOne(924).getValue()), "month")) {
|
||||
if (errMsg == null && !DataLimitUtil.isAccessAllowed(zhiFuBao+certName, Integer.parseInt(commonRepository.findOne(924).getValue()), "month")) {
|
||||
errMsg = "支付宝信息修改失败: 相同支付宝账号每月可绑定次数已用完";
|
||||
}
|
||||
|
||||
if (!ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", Integer.parseInt(commonRepository.findOne(925).getValue()), "month")) {
|
||||
if (errMsg == null && !ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", Integer.parseInt(commonRepository.findOne(925).getValue()), "month")) {
|
||||
errMsg = "支付宝信息修改失败: 每月可修改次数已用完,请联系管理员";
|
||||
}
|
||||
|
||||
@@ -133,42 +133,47 @@ public class AppController {
|
||||
}
|
||||
|
||||
|
||||
String authErrMsg = null;
|
||||
if (StrUtil.isNotBlank(certNum) && !certNum.equals(userInfo.getCertNo())) {
|
||||
if (StrUtil.isNotBlank(userEntity.getZhiFuBaoName()) && !certName.equals(userEntity.getZhiFuBaoName())) {
|
||||
errMsg = "实名修改失败: 姓名与绑定支付宝信息不相符";
|
||||
authErrMsg = "实名修改失败: 姓名与绑定支付宝信息不相符";
|
||||
}
|
||||
if (!IdcardUtil.isValidCard(certNum)) {
|
||||
errMsg = "实名修改失败: 身份证号码有误";
|
||||
if (authErrMsg == null && !IdcardUtil.isValidCard(certNum)) {
|
||||
authErrMsg = "实名修改失败: 身份证号码有误";
|
||||
}
|
||||
|
||||
Integer idCount = userInfoService.countCertCount(certName, certNum);
|
||||
if (idCount > 1) {
|
||||
errMsg = "实名修改失败: 此实名信息已存在";
|
||||
if (authErrMsg == null) {
|
||||
Integer idCount = userInfoService.countCertCount(certName, certNum);
|
||||
if (idCount > 1) {
|
||||
authErrMsg = "实名修改失败: 此实名信息已存在";
|
||||
}
|
||||
}
|
||||
|
||||
if (!ApiAccessLimitUtil.isAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 1, "month")) {
|
||||
errMsg = "实名修改失败: 每月可修改次数已用完,请联系管理员";
|
||||
if (authErrMsg == null && !ApiAccessLimitUtil.isAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 1, "month")) {
|
||||
authErrMsg = "实名修改失败: 账号每月可修改次数已用完,请联系管理员";
|
||||
}
|
||||
|
||||
try {
|
||||
aliService.authCertNo(certName, certNum);
|
||||
}catch (Exception e) {
|
||||
ApiAccessLimitUtil.removeKey(String.valueOf(userId), "updateAuthCertInfo");
|
||||
errMsg = "实名修改失败: 身份证信息不匹配";
|
||||
if (authErrMsg == null && !ApiAccessLimitUtil.isAccessAllowed(certName, "updateAuthCertInfoByIdCard", 1, "month")) {
|
||||
authErrMsg = "实名修改失败: 此身份证信息次月已绑定过,请联系管理员";
|
||||
}
|
||||
|
||||
if (errMsg != null && errMsg.contains("实名修改失败")) {
|
||||
return Result.error(errMsg);
|
||||
if (authErrMsg == null) {
|
||||
try {
|
||||
aliService.authCertNo(certName, certNum);
|
||||
userInfo.setCertName(certName);
|
||||
userInfo.setCertNo(certNum);
|
||||
userInfo.setUpdateTime(DateUtil.date());
|
||||
userInfoService.update(userInfo, new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId));
|
||||
}catch (Exception e) {
|
||||
ApiAccessLimitUtil.removeKey(String.valueOf(userId), "updateAuthCertInfo");
|
||||
ApiAccessLimitUtil.removeKey(certName, "updateAuthCertInfoByIdCard");
|
||||
authErrMsg = "实名修改失败: 身份证信息不匹配";
|
||||
}
|
||||
}
|
||||
|
||||
userInfo.setCertName(certName);
|
||||
userInfo.setCertNo(certNum);
|
||||
userInfo.setUpdateTime(DateUtil.date());
|
||||
userInfoService.update(userInfo, new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId));
|
||||
}
|
||||
|
||||
if (errMsg != null) {
|
||||
return Result.error(errMsg);
|
||||
if (errMsg != null || authErrMsg != null) {
|
||||
return Result.error(errMsg + " " + authErrMsg);
|
||||
}
|
||||
return Result.success();
|
||||
// 去除首绑支付宝奖励
|
||||
|
||||
@@ -146,7 +146,7 @@ public class CourseDetailsServiceImpl extends ServiceImpl<CourseDetailsDao, Cour
|
||||
} else {
|
||||
course.setViewCounts(course.getViewCounts() + 1);
|
||||
}
|
||||
if (ApiAccessLimitUtil.isAccessAllowed("setCourseView:" + course.getCourseId(), "updateAuthCertInfo", 1, 600)) {
|
||||
if (ApiAccessLimitUtil.isAccessAllowed(course.getCourseId().toString(), "updateWeekCourseView", 1, 600)) {
|
||||
int courseViewCount = redisServiceImpl.getCourseWeekViewCount(course.getCourseId());
|
||||
course.setWeekView(courseViewCount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user