To improve the corrosion resistance and wear resistance of AZ31B magnesium alloy, in this dissertation, we use the method making AZ31B magnesium alloy as the matrix to make coating on the way of electroless plating nickel-phosphor directly. In this study, we make experiments on the influence of concentration of complexing agent in electroplating to electroless plating on the surface of magnesium alloy. We utilize the scanning electron microscopy (SEM), energy dispersive spectroscopy (EDS) and the detection of corrosion resistance etc. To analyze the morphology, composition and corrosion resistance of coating. We come to a conclusion that the reaction is at the soonest when we adopt sodium citrate as buffering agent and its density is10ml/L., meanwhile, the coating particle is tiny and is well-knit with matrix. What’s more, phosphorus contents are maximum and the corrosion resistance is greatest.