Skip to content

Commit 746e2a6

Browse files
committed
fix: Get Uuids
1 parent dc03d5d commit 746e2a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

service/peer.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,14 @@ func (ps *PeerService) GetUuidListByIDs(ids []uint) ([]string, error) {
126126
err := DB.Model(&model.Peer{}).
127127
Where("row_id in (?)", ids).
128128
Pluck("uuid", &uuids).Error
129-
return uuids, err
129+
//过滤uuids中的空字符串
130+
var newUuids []string
131+
for _, uuid := range uuids {
132+
if uuid != "" {
133+
newUuids = append(newUuids, uuid)
134+
}
135+
}
136+
return newUuids, err
130137
}
131138

132139
// BatchDelete 批量删除, 同时也应该删除token

0 commit comments

Comments
 (0)