Perovskite thin films often have numerous defects on their surface and at their grain boundaries. These defects can lead to nonradiative complexation of photogenerated carriers, which can significantly reduce the photovoltaic performance of photovoltaic devices. Oxygen-doped graphite-phase carbon nitride (g-C3N4-O) was utilized as an interfacial modification layer in perovskite solar cells (PSCs). The modification of the perovskite films resulted in preferential orientation of the (110) facets. The crystallinity of the (110) facets with high photovoltaic performance increased from 75.11° to 78.62°, and the half-peak width decreased by 37.73%. The film surface is now flatter, more uniformly dense, and free of pinholes. The interfacial fluorescence lifetime has been reduced by 32.51%, and the charge transport and extraction capacity have significantly increased. XPS demonstrated that the N atoms in g-C3N4-O bonded with the under-coordinated Pb ions in the perovskite films, passivating the deep energy level defects at the interface and improving charge transport and extraction.