Commit 4eec9b4a by fanjiaxin

新加入实名认证开关

parent 13a91331
Pipeline #75566 passed with stages
in 1 minute 22 seconds
package com.netease.yanxuan.wx.store.sharer.biz.config;
import com.ctrip.framework.apollo.spring.annotation.EnableAutoUpdateApolloConfig;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @Description 应用配置
* @Author fanjiaxin
* @Date 2025/3/10 17:26
*/
@Data
@Component
@EnableAutoUpdateApolloConfig
public class AppConfig {
/**
* 实名认证
*/
@Value("${sys.realName.authenticated.enabled:true}")
private Boolean realNameAuthenticatedEnabled;
}
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.netease.yanxuan.wx.store.sharer.biz.service.impl; ...@@ -3,6 +3,7 @@ package com.netease.yanxuan.wx.store.sharer.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.netease.yanxuan.wx.store.sharer.biz.config.AppConfig;
import com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig; import com.netease.yanxuan.wx.store.sharer.biz.config.DrmSharerConfig;
import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserContextHolder; import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserContextHolder;
import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserHelper; import com.netease.yanxuan.wx.store.sharer.biz.core.LoginUserHelper;
...@@ -51,6 +52,7 @@ import java.util.Date; ...@@ -51,6 +52,7 @@ import java.util.Date;
@Service @Service
public class UserServiceImpl implements IUserService { public class UserServiceImpl implements IUserService {
private final AppConfig appConfig;
private final SharerInfoMapper sharerInfoMapper; private final SharerInfoMapper sharerInfoMapper;
private final LoginUserHelper loginUserHelper; private final LoginUserHelper loginUserHelper;
private final WeChatUserInfoRequest weChatUserRequest; private final WeChatUserInfoRequest weChatUserRequest;
...@@ -205,9 +207,13 @@ public class UserServiceImpl implements IUserService { ...@@ -205,9 +207,13 @@ public class UserServiceImpl implements IUserService {
iSmsService.verifySmsCode(SmsScenesEnum.REAL_NAME_AUTHENTICATED.name(), iSmsService.verifySmsCode(SmsScenesEnum.REAL_NAME_AUTHENTICATED.name(),
bo.getMobilePhone(), bo.getSmsCode()); bo.getMobilePhone(), bo.getSmsCode());
// 验证身份信息 // 验证身份信息
Boolean isVerifySuccess = iUserInfoClient.verifyByIdentityNo(bo.getUsername(), bo.getIdCardNumber()); Boolean realNameAuthenticatedEnabled = appConfig.getRealNameAuthenticatedEnabled();
if(null == isVerifySuccess || !isVerifySuccess){ if(null == realNameAuthenticatedEnabled || realNameAuthenticatedEnabled){
throw new BizException("实名认证不通过"); log.info("op:realNameAuthenticated:realNameAuthenticatedEnabled is enabled");
Boolean isVerifySuccess = iUserInfoClient.verifyByIdentityNo(bo.getUsername(), bo.getIdCardNumber());
if(null == isVerifySuccess || !isVerifySuccess){
throw new BizException("实名认证不通过");
}
} }
// 验证通过后更新实名认证信息 // 验证通过后更新实名认证信息
LoginUserInfo loginUserInfo = LoginUserContextHolder.get(); LoginUserInfo loginUserInfo = LoginUserContextHolder.get();
......
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