  If dark matter decay or annihilate, a large amount of energy and particles
would be released into the cosmic plasma. Therefore, they could modify the
thermal and ionization history of our universe, then leave footprints on the
cosmic microwave background power spectra. In this paper, we take dark matter
annihilation as an example and investigate whether different reionization
models influence the constraints on dark matter annihilation. We consider the
ionization history including both dark matter annihilation and star formation,
then put constraints on DM annihilation. Combining the latest Planck data, BAO
data, SNIa measurement, $Q_\text{HII}$ constraints from observations of
quasars, as well as the star formation rate density from UV and IR data, the
optical depth is $\tau=0.0571^{+0.0005}_{-0.0006}$ at 68$\%$C.L. and the upper
limit of $\epsilon_0 f_d$ reads $2.7765\times 10^{-24}$ at 95$\%$C.L.. By
comparison, we also constrain dark matter annihilation in the instantaneous
reionization model from the same data combination except the $Q_\text{HII}$
constraints and star formation rate density. We get
$\tau=0.0559^{+0.0069}_{-0.0076}$ at 68$\%$C.L. and the upper limit of
$\epsilon_0 f_d$ is $2.8468\times 10^{-24}$ at 95$\%$C.L.. %, which is $2.5\%$
higher than the results in the previous model. This indicates various
reionization models have little influence ($\lesssim 2.5\%$) on constraining
parameters of dark matter decay or annihilation.
