fix(01-01): 修复 C 端实名校验使用常量(CRITICAL-02)
- client_order/service.go: 实名校验 assetInfo.RealNameStatus != 1 改为常量比较 - client_realname.go: 实名状态检查 == 1 改为 constants.RealNameStatusVerified - go build ./... 编译通过,无遗留硬编码 != 1 / == 1 的实名判断
This commit is contained in:
@@ -125,7 +125,7 @@ func (h *ClientRealnameHandler) GetRealnameLink(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 6. 检查实名状态
|
// 6. 检查实名状态
|
||||||
if targetCard.RealNameStatus == 1 {
|
if targetCard.RealNameStatus == constants.RealNameStatusVerified {
|
||||||
return errors.New(errors.CodeInvalidStatus, "该卡已完成实名")
|
return errors.New(errors.CodeInvalidStatus, "该卡已完成实名")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ func (s *Service) CreateOrder(ctx context.Context, customerID uint, req *dto.Cli
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if packagesNeedRealname(validationResult.Packages) && assetInfo.RealNameStatus != 1 {
|
if packagesNeedRealname(validationResult.Packages) && assetInfo.RealNameStatus != constants.RealNameStatusVerified {
|
||||||
return nil, errors.New(errors.CodeNeedRealname)
|
return nil, errors.New(errors.CodeNeedRealname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user