In order to improve the corrosion resistance of magnesium alloy,Ni-P/Ni composite coating was prepared on the surface of AZ31B magnesium alloy using chemical plating and pulse plating techniques.Scan electron microscope(SEM)and X-ray diffractometer(XRD)were employed to detect the surface morphology and composition of the composite coating.Besides,the corrosion resistance and hydrophobicity of the composite coating were investigated by electrochemical polarization,impedance tests and contact angle tests.The results show that with the peak current density of 30 mA/cm2,the coating has the most detailed grain,the highest contact angle of 117.3°,the highest self-corrosion potential(-0.4510 V),the lowest corrosion current density(1.94×10-7 A/cm2),and the largest impedance value,which is obviously better than that of the magnesium alloy matrix,indicating that the composite coating could improve the hydrophobicity and corrosion resistance of magnesium alloy.