In this paper, ZnO/NiO composites rich in oxygen vacancies are prepared by the solvothermal method and reduction method. In the test, through the use of X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS), scanning electron microscopy (SEM), transmission electron microscope (TEM), diffuse reflectance spectroscopy (DRS), photoluminescence spectroscopy (PL), and electron paramagnetic resonance (EPR), we effectively prove the existence of phase, morphology and oxygen vacancies in the material. Through the photocatalysis test and gas sensitivity test, it is found that 10% Ni doped OZN-10 has the best photocatalytic activity and gas sensitivity characteristics. The degradation rate of methylene blue (MB) was 98%. The gas sensitivity test shows that OZN-10 has good selectivity, good response performance (3000 ppm, 27,887%) and excellent response recovery time (response time: 50 s, recovery time: 5–7 s) for saturated NH3 gas at standard atmospheric pressure (101.325 KPa) and room temperature (25 °C). The synergistic effect of oxygen vacancy as the center of a trap and p–n heterojunction forming an electric potential field at the interface is explained, and the mechanism of improving photocatalysis and gas sensitivity is analyzed. This work will provide an innovative vision for dual-performance oxygen vacancy modification of heterojunctions through photocatalysis.