The development of an efficient photocatalyst to remove pollutants from wastewater is pivotal to solving the problem of environmental pollution. This study reports a Z-scheme heterojunction between oxygen-doped carbon nitride (OCN) and MgIn2S4 (MIS), which can exhibit excellent photocatalytic ability on both reduction of U (VI) and oxidation of methyl orange (MO) without sacrificial agents. The internal structure of OCN/MIS can be effectively adjusted by changing the amount of MIS, leading to an enhancement of the separation rate of carriers and the inhibition of the photocorrosion for MgIn2S4. The reaction rate constants of U(VI) reduction and MO degradation by the optimized MIS2.5/OCN were 56 and 8 times higher than those of OCN and 3 times and twice higher than those of MIS, respectively. This study provides a novel approach for constructing graphitic carbon nitride-based Z-scheme heterojunction photocatalysts to deal with environmental pollution problem without sacrificial agents.