In this paper, we discuss codes for distributed storage systems with hierarchical repair properties. Specifically, we devote attention to the repair problem of the rack-aware storage model with locality, aiming to enhance the system's ability to repair a small number of erasures within each rack by locality and efficiently handling a rack erasure with a small repair bandwidth. By employing the regenerating coding technique, we construct a family of array codes with $(r,u-r+1)$-locality, where the $u$ nodes of each repair set are systematically organized into a rack. When the number of failures is less than $u - r + 1$, these failures can be repaired without counting the system bandwidth. In cases where the number of failures exceeds the locality, the failed nodes within a single rack can be recovered with optimal cross-rack bandwidth.