This commit is contained in:
Mrx
2026-03-11 16:34:14 +08:00
parent 2c99e6b6a4
commit 84a84f204b
3 changed files with 20 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ type (
LevelName string `json:"level_name"` // 等级名称 LevelName string `json:"level_name"` // 等级名称
Region string `json:"region"` // 区域 Region string `json:"region"` // 区域
Mobile string `json:"mobile"` // 手机号 Mobile string `json:"mobile"` // 手机号
Name string `json:"name"` // 姓名(实名认证)
IdCard string `json:"id_card"` // 身份证号(解密后明文,未实名为空)
WechatId string `json:"wechat_id"` // 微信号 WechatId string `json:"wechat_id"` // 微信号
TeamLeaderId string `json:"team_leader_id"` // 团队首领ID TeamLeaderId string `json:"team_leader_id"` // 团队首领ID
AgentCode int64 `json:"agent_code"` AgentCode int64 `json:"agent_code"`

View File

@@ -2,6 +2,7 @@ package admin_agent
import ( import (
"context" "context"
"encoding/hex"
"qnc-server/app/main/api/internal/svc" "qnc-server/app/main/api/internal/svc"
"qnc-server/app/main/api/internal/types" "qnc-server/app/main/api/internal/types"
@@ -82,8 +83,21 @@ func (l *AdminGetAgentListLogic) AdminGetAgentList(req *types.AdminGetAgentListR
// 查询实名认证信息 // 查询实名认证信息
realNameInfo, _ := l.svcCtx.AgentRealNameModel.FindOneByAgentId(l.ctx, agent.Id) realNameInfo, _ := l.svcCtx.AgentRealNameModel.FindOneByAgentId(l.ctx, agent.Id)
isRealName := false isRealName := false
realName := ""
realIdCard := ""
if realNameInfo != nil && realNameInfo.VerifyTime.Valid { if realNameInfo != nil && realNameInfo.VerifyTime.Valid {
isRealName = true // verify_time不为空表示已通过三要素核验 isRealName = true // verify_time不为空表示已通过三要素核验
realName = realNameInfo.Name
if realNameInfo.IdCard != "" {
encKey, keyErr := hex.DecodeString(l.svcCtx.Config.Encrypt.SecretKey)
if keyErr != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理信息, 解密身份证密钥失败: %v", keyErr)
}
realIdCard, err = crypto.DecryptIDCard(realNameInfo.IdCard, encKey)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "获取代理信息, 解密身份证失败: %v", err)
}
}
} }
wechatId := "" wechatId := ""
@@ -108,6 +122,8 @@ func (l *AdminGetAgentListLogic) AdminGetAgentList(req *types.AdminGetAgentListR
LevelName: levelName, LevelName: levelName,
Region: region, Region: region,
Mobile: agent.Mobile, Mobile: agent.Mobile,
Name: realName,
IdCard: realIdCard,
WechatId: wechatId, WechatId: wechatId,
TeamLeaderId: teamLeaderId, TeamLeaderId: teamLeaderId,
AgentCode: agent.AgentCode, AgentCode: agent.AgentCode,

View File

@@ -1048,6 +1048,8 @@ type AgentListItem struct {
LevelName string `json:"level_name"` // 等级名称 LevelName string `json:"level_name"` // 等级名称
Region string `json:"region"` // 区域 Region string `json:"region"` // 区域
Mobile string `json:"mobile"` // 手机号 Mobile string `json:"mobile"` // 手机号
Name string `json:"name"` // 姓名(实名认证)
IdCard string `json:"id_card"` // 身份证号(解密后明文,未实名为空)
WechatId string `json:"wechat_id"` // 微信号 WechatId string `json:"wechat_id"` // 微信号
TeamLeaderId string `json:"team_leader_id"` // 团队首领ID TeamLeaderId string `json:"team_leader_id"` // 团队首领ID
AgentCode int64 `json:"agent_code"` AgentCode int64 `json:"agent_code"`