We investigate the lateral variations of photocurrent on CdS/Al interfaces, with a combination of a semiconductor characterization system and scanning near-field optical microscopy, in which the near-field probe is used to locally induce photocurrent on the CdS/Al interfaces with high spatial resolution. By analyzing the spatially resolved photoresponse, we find that the resolution is worsened in the photocurrent images by the lateral diffusion of the photoexcited electrons and that the photoelectric properties of the CdS/Al interfaces are strongly affected by the bias voltage. Furthermore, in a complementary experiment, we also demonstrate that the photocurrent measurements can reveal structures that are not present in the case of shear-force data. The analysis demonstrates the band structure and microscopic mechanism of CdS/Al heterostructures, which provide an effective approach for developing CdS-based photoelectronic devices.