The shallow decay phase of the early X-ray afterglow in gamma-ray bursts discovered by Swift is a widely discussed topic. As the spectral index does not change at the transferring of the shallow decay phase to a normal phase, it implies this transferring should be a dynamical change rather than a spectral evolution. We suggest both the shallow decay phase and the normal phase are from the external shock in a wind environment, while the transferring time is the deceleration time. We apply this model to GRBs 050319 and 081008, and find them can be well explained by choosing a proper set of parameters.PACS numbers: 98.70. Rz, 94.05.Dd, 98.58.Fd