fix: 管理员认证列表按第一页返回待审批申请
This commit is contained in:
@@ -36,9 +36,17 @@ func (l *GetVerificationsLogic) GetVerifications(req *types.GetPendingListReq) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
page := req.Page
|
||||||
|
if page < 1 {
|
||||||
|
page = 1
|
||||||
|
}
|
||||||
|
limit := req.Size
|
||||||
|
if limit <= 0 {
|
||||||
|
limit = 20
|
||||||
|
}
|
||||||
verifications, err := l.svcCtx.UserVerificationsRpc.SearchUserVerifications(l.ctx, &pb.SearchUserVerificationsReq{
|
verifications, err := l.svcCtx.UserVerificationsRpc.SearchUserVerifications(l.ctx, &pb.SearchUserVerificationsReq{
|
||||||
Page: req.Page,
|
Page: page - 1,
|
||||||
Limit: req.Size,
|
Limit: limit,
|
||||||
Role: req.Role,
|
Role: req.Role,
|
||||||
Status: req.Status,
|
Status: req.Status,
|
||||||
})
|
})
|
||||||
@@ -46,7 +54,7 @@ func (l *GetVerificationsLogic) GetVerifications(req *types.GetPendingListReq) (
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var searchResults []types.VerificationItem
|
searchResults := make([]types.VerificationItem, 0, len(verifications.UserVerifications))
|
||||||
for _, v := range verifications.UserVerifications {
|
for _, v := range verifications.UserVerifications {
|
||||||
temp := types.VerificationItem{}
|
temp := types.VerificationItem{}
|
||||||
err = copier.Copy(&temp, v)
|
err = copier.Copy(&temp, v)
|
||||||
|
|||||||
Reference in New Issue
Block a user