Spectrally Switchable Photodetection with Near-Infrared-Absorbing Covalent Organic Frameworks