Wavelength-resolved fluorescence lifetimes of gas-phase ions: CO2+ and CS2+