We present the model that two-level system (TLS) nonlocally interacts with one-dimensional coupled-resonator array (CRA). The coherent transport of single-photon inside CRA is well controlled by the state of TLS, which functions as quantum switch. Spin up and spin down correspond to switch on and switch off respectively, or vice versa, which originate from the constructive interference and the destructive interference of two coupling paths. We improve the fidelity of quantum switch by preadjusting the frequency of resonators which couple to TLS. Quantum switch realizes quantum beam splitter when TLS is in the superposition state. The single-photon wave packet would entangle with qubit and propagate to the remote resonators.