In order to modify the mechanical and magnetic characteristics of high-entropy alloys (HEAs), phase transformation has been extensively studied. However, the impact of phase transformation on corrosion resistance has received less attention. In this paper, the intensive investigation of BCC/B2 to FCC phase transformation of equiatomic AlCoCrFeNi reveals the correlation between corrosion resistance and microstructure transformation under different heat treatment temperatures. Combined with differential scanning calorimetry (DSC), X-ray diffraction (XRD), scanning electron microscope (SEM) and electron backscattered diffraction (EBSD), the phase transformation of equiatomic AlCoCrFeNi heat treated with increasing temperature is BCC + B2 (as-cast) → BCC + B2 (600 °C) → BCC + B2+ FCC +σ (850 °C) → BCC + B2+ FCC (1100 °C). Combined with the results of SKPFM, immersion tests, and electrochemical measurements, the alloy treated at 1100 °C has the most excellent corrosion resistance due to its unique phase composition with the highest FCC phase and no intermetallic.