In this paper, the optical diodes has been designed by one-dimensional function photonic crystals (FPCs), which the refractive indexes of media A and B are not constant, but it is the functions of space coordinate. By calculation the transmissivity and electric field distribution, we found the positive incident light can pass the function photonic crystals, but the negative incident light can not pass through it, the function photonic crystals (FPCs) can be made into optical diodes.