The g-C3N4 nanosheets coupled BiOI (g-C3N4/BiOI) nanocomposites with unique heterojunction structure and excellent wide-spectrum sunlight absorption properties have been developed via molten-salt-chemistry-assisted strategy. The heterostructured g-C3N4/BiOI shows enhanced solar to the thermal effect, improved electron mobility and carrier lifetime for efficient photocatalytic dye degradation. The engineered g-C3N4/BiOI catalyst exhibits outstanding photocatalytic activity for methyl orange (MO) removal with 100 % degradation conversion and excellent stability under solar light irradiation, which is respectively 2.69 and 1.27 times higher than those of g-C3N4 and BiOI counterparts. The broad scope toward other dyes degraded by g-C3N4/BiOI and the generality of the molten-salt-chemistry-assisted strategy for synthesizing g-C3N4/BiOCl and g-C3N4/BiOBr with considerable photodegradation efficiency are proved. The analysis of kinetic behaviors, electron spin resonance, and nanosecond transient absorption spectra for structure-activity relationship, key intermediate of •O2− species, and excited state lifetime of g-C3N4/BiOI heterojunction material in the photocatalytic MO degradation processes are also demonstrated.