As part of the drug repurposing process, it is imperative to predict the interactions between drugs and target proteins in an accurate and efficient manner. With the introduction of contrastive learning into drug-target prediction, the accuracy of drug repurposing will be further improved. However, a large part of DTI prediction methods based on deep learning either focus only on the structural features of proteins and drugs extracted using GNN or CNN, or focus only on their relational features extracted using heterogeneous graph neural networks on a DTI heterogeneous graph. Since the structural and relational features of proteins and drugs describe their attribute information from different perspectives, their combination can improve DTI prediction performance. We propose a relational similarity-based graph contrastive learning for DTI prediction (RSGCL-DTI), which combines the structural and relational features of drugs and proteins to enhance the accuracy of DTI predictions. In our proposed method, the inter-protein relational features and inter-drug relational features are extracted from the heterogeneous drug-protein interaction network through graph contrastive learning, respectively. The results demonstrate that combining the relational features obtained by graph contrastive learning with the structural ones extracted by D-MPNN and CNN enhances feature representation ability, thereby improving DTI prediction performance. Our proposed RSGCL-DTI outperforms eight SOTA baseline models on the four benchmark datasets, performs well on the imbalanced dataset, and also shows excellent generalization ability on unseen drug-protein pairs.