In the context of the spread of the new crown epidemic, periocular recognition has become an effective alternative in less constrained environments where the face is inconvenient to obtain. Although the periocular recognition algorithms based on deep learning have made great progress, the network performance is expected to be further improved with fewer parameters in the practical applications. In this work, we proposed a lightweight CNN based on the combination of an attention mechanism and mid-level features, referred to as AttenMidNet. This attention module is directly inserted into the convolution blocks at all levels to adaptively assign weights to the feature channels to obtain the mid-level features with the most information. Then the mid-level features at all levels are contacted to form the final feature representation vector. This method not only expresses the features more comprehensively, but also drastically reduces the number of network parameters. The experimental results using within-dataset and cross-dataset evaluation on three publicly available datasets (UBIRIS.v2, CASIA_Iris_Distance, CASIA_Iris_Twins, and one self-collected periocular dataset) have proved the effectiveness of the proposed network. Moreover, a compact and efficient periocular recognition system including access control and mobile terminals was designed using the proposed network. In addition to the real-time detection and matching of periocular images, the access control terminal can also realize scanning and verification of QR code images. During the peak period of people flow, users can log in to the online periocular recognition system via the mobile terminal in advance for matching authentication. If successful, the corresponding QR code will be generated, through which to reduce crowd gathering time.