Two-layer hydroxyapatite film was prepared on WE43 magnesium alloy surface by electrochemical deposition method.XRD results showed that the film consisted of flake-like CaHPO_4·2H_2O and spindle hydroxyapatite after pretreatment,and the film consisted of spindle hydroxyapatite and Ca(OH)_2 after hot dip process.Polarization curves showed that the compact hydroxyapatite film could improve the corrosion resistance of WE43 magnesium alloy significantly when immered in simulated body fluid(SBF).Ca(OH)_2 was generated due to the relatively high concentration of hot 0.5 mol/L NaOH in the solution.