How to Bridge Spatial and Temporal Heterogeneity in Link Prediction? A Contrastive Method