A resonant-cavity-enhanced type-II superlattice (T2SL) infrared detector based on a metal grating has been designed to address the weak photon capture and low quantum efficiency (QE) issues of T2SL infrared detectors. Simulations have been conducted to analyze the effects of metal grating parameters, including length, thickness, and incident angle, on the spectral response and absorptivity of the absorption layers in T2SL infrared detectors. By optimizing the design, an appropriate resonant cavity structure was obtained. Research results indicate that the resonant cavity structure can significantly enhance the absorption rate of a T2SL infrared detector with a 0.2µm thick absorption layer in the 3-5µm wavelength range, observing peak absorption rates at 3.82µm and 4.73µm, with values of 97.6% and 98.2%, respectively. The absorption rate of the 0.2µm thick T2SL absorption layer at peak wavelengths increased from 6.03% and 2.3% to 54.48% and 27.91%, respectively. The implementation of the resonant-cavity-enhanced T2SL infrared detector improves the QE while reducing absorption layer thickness, thus opening up new avenues for improving T2SL detector performance.