To address the problem that session-based recommendation models ignore temporal information and spatial relationships among items, leading to an inability to capture complex transition patterns among items accurately, a session-based recommendation model based on time-aware and space-enhanced dual channel Graph Neural Network (GNN) was proposed. Firstly, for the temporal channel, adaptive temporal weights were used to process the items, thereby constructing a time-aware session graph, and the users’ interest-shifting patterns were captured through a time-aware GNN. Secondly, for the spatial channel, spatial relationships among items were embedded into a Graph ATtention network (GAT), so as to aggregate the information from the perspective of spatial graph structure. Finally, a contrastive learning strategy was introduced to enhance recommendation performance. The results of comparative experiments conducted on three publicly available datasets, Diginetica, Tmall, and Nowplaying — where the proposed model was compared with baseline models including Atten-Mixer (multi-level Attention Mixture network) and GCE-GNN (Global Context Enhanced GNN) — show that the proposed model achieves superior precision (P) and Mean Reciprocal Rank (MRR). Compared to the suboptimal results, the proposed model has the P@10 improved by 2.09%, 24.97%, and 10.45%, respectively, and the MRR@10 improved by 2.52%, 11.60%, and 4.43%, respectively.