The formation of a double-horn current profile is a challenging issue in the achievement of electron bunch with high peak current, especially for high-repetition-rate Xray free-electron lasers (XFELs) where more nonlinear and intricate beam dynamics propagation is involved. Here, we propose to correct the nonlinear beam longitudinal phase space distortion in the photoinjector section with a dual-mode buncher. In combination with the evolutionary many-objective beam dynamics optimization, this method is shown to be effective in manipulating the longitudinal phase space at the injector exit. Furthermore, the formation of the current spike is avoided after the multi-stage charge density modulation and electron bunch with a peak current of 1.6 kA is achieved for 100-pC bunch charge. Start-to-end simulations based on the Shanghai high-repetition-rate XFEL and extreme light facility demonstrate that the proposed scheme can increase the FEL pulse energy by more than 3 times in a cascading operation of echo-enabled harmonic generation and high-gain harmonic generation. Moreover, this method can also be used for longitudinal phase space shaping of electron beams operating at a high repetition rate to meet the specific demands of different researches.