We demonstrate a compact tunable and switchable dual-wavelength fiber laser based on the Lyot filtering effect and the spontaneous radiation peaks of gain fiber. By introducing a period of polarization-maintain Er-doped fiber (PM-EDF), stable dual-wavelength pulses can operate in both the anomalous dispersion region and the normal dispersion region. The corresponding repetition frequency difference of the dual wavelengths has excellent stability while the relative center wavelength can be adjusted in the range of 5 nm to 13 nm. There is no existence of significant sidebands in the optical spectrum during the whole tuning process. This dual-wavelength laser based on two spontaneous radiation peaks in the shorter wavelength direction has great application potential. Our work provides a new design solution for dual-comb sources (DCSs).