  The cosmic-ray (CR) $e^\pm$ excess observed by AMS-02 can be explained by
dark matter (DM) annihilation. However, the DM explanation requires a large
annihilation cross section which is strongly disfavored by other observations,
such as the Fermi-LAT gamma-ray observation of dwarf galaxies and the Planck
observation of the cosmic microwave background (CMB). Moreover, the DM
annihilation cross section required by the CR $e^\pm$ excess is also too large
to generate the correct DM relic density with thermal production. In this work
we use the Breit-Wigner mechanism with a velocity dependent DM annihilation
cross section to reconcile these tensions. If DM particles accounting for the
CR $e^\pm$ excess with $v\sim \mathcal{O}(10^{-3})$ are very close to a
resonance in the physical pole case, their annihilation cross section in the
Galaxy reaches a maximal value. On the other hand, the annihilation cross
section would be suppressed for DM particles with smaller relative velocities
in dwarf galaxies and at recombination, which may affect the gamma-ray and CMB
observations, respectively. We find a proper parameter region that can
simultaneously explain the AMS-02 results and the thermal relic density, while
satisfying the Fermi-LAT and Planck constraints.
