We present a design of all-optical switches based on one-dimensional photonic crystals (1D PhC) doped with nonlinear optical materials. The 1D PhC switch structure is composed of a PhC cavity sandwiched by two accessional PhC microcavities. The center PhC cavity has two resonant frequencies with nearly the same quality factors ( Q), while the accessional PhC cavities have the same resonant frequency, which is equal to one of the resonant frequencies of the center cavity. The two accessional PhC cavities cause reduction of Q value in this resonant frequency and result in different Q values of two modes. We realize all-optical switch effect by selecting pump light wavelength at the low Q mode and probe light wavelength at the other mode. The theoretical simulations by using the finite difference time domain method show that the pump light intensity required to realize optical switch effect in the designed switch is 50 times smaller than that in one-dimensional photonic crystals cavity with only one resonant mode.