f
This commit is contained in:
@@ -2,6 +2,7 @@ package admin_agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
|
||||
"qnc-server/app/main/api/internal/svc"
|
||||
"qnc-server/app/main/api/internal/types"
|
||||
@@ -90,12 +91,15 @@ func (l *AdminGetAgentListLogic) AdminGetAgentList(req *types.AdminGetAgentListR
|
||||
}
|
||||
realName = realNameInfo.Name
|
||||
if realNameInfo.IdCard != "" {
|
||||
decrypted, err := crypto.DecryptIDCard(realNameInfo.IdCard, []byte(l.svcCtx.Config.Encrypt.SecretKey))
|
||||
key, keyErr := hex.DecodeString(l.svcCtx.Config.Encrypt.SecretKey)
|
||||
if keyErr == nil {
|
||||
decrypted, err := crypto.DecryptIDCard(realNameInfo.IdCard, key)
|
||||
if err == nil {
|
||||
idCardPlain = decrypted
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wechatId := ""
|
||||
if agent.WechatId.Valid {
|
||||
|
||||
@@ -2,15 +2,15 @@ package admin_agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
|
||||
"qnc-server/app/main/api/internal/svc"
|
||||
"qnc-server/app/main/api/internal/types"
|
||||
"qnc-server/common/globalkey"
|
||||
"qnc-server/common/xerr"
|
||||
"qnc-server/pkg/lzkit/crypto"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"qnc-server/app/main/api/internal/svc"
|
||||
"qnc-server/app/main/api/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
@@ -72,10 +72,12 @@ func (l *AdminGetAgentRealNameListLogic) AdminGetAgentRealNameList(req *types.Ad
|
||||
}
|
||||
}
|
||||
|
||||
// 解密身份证号(仅显示部分)
|
||||
// 解密身份证号(仅显示部分,密钥与实名认证写入时一致:hex 解码后使用)
|
||||
idCard := ""
|
||||
if realName.IdCard != "" {
|
||||
decrypted, err := crypto.DecryptIDCard(realName.IdCard, []byte(l.svcCtx.Config.Encrypt.SecretKey))
|
||||
key, keyErr := hex.DecodeString(l.svcCtx.Config.Encrypt.SecretKey)
|
||||
if keyErr == nil {
|
||||
decrypted, err := crypto.DecryptIDCard(realName.IdCard, key)
|
||||
if err == nil {
|
||||
// 脱敏显示
|
||||
if len(decrypted) > 10 {
|
||||
@@ -85,6 +87,7 @@ func (l *AdminGetAgentRealNameListLogic) AdminGetAgentRealNameList(req *types.Ad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据verify_time判断状态:NULL=未验证(1),不为NULL=已通过(2)
|
||||
statusInt := int64(1) // 默认未验证
|
||||
|
||||
Reference in New Issue
Block a user