We study the Josephson effect in spin-triplet superconductor−quantum anomalous Hall insulator−spin-triplet superconductor junctions using the nonequilibrium Green function method. The current-phase difference relations show strong dependence on the orientations of the d-vectors in superconductors. We focus on two d-vector configurations, the parallel one with the left and right d-vectors being in the same direction, and the nonparallel one with the left d-vector fixed at the z-axis. For the parallel configuration, the 0-π transition can be realized when one rotates the d-vectors from the parallel to the junction plane to the perpendicular direction. The φ0 phase with nonzero Josephson current at zero phase difference can be obtained as long as dxdz = 0. For the nonparallel configuration, the 0-π transition and the φ0 phase still exist. The condition for the formation of the φ0 phase becomes dRx = 0. The switch effects of the Josephson current are found in both configurations when the d-vectors are rotated in the xy plane. Furthermore, the symmetries satisfied by the current-phase difference relations are analysed in details by the operations of the time-reversal, mirror-reflections, the spin-rotation and the gauge transformation, which can well explain the above selection rules for the φ0 phase. Our results reveal the peculiar Josephson effect between spin-triplet superconductors and the quantum anomalous Hall insulator, which provide helpful phases and effects for the device designs. The distinct current-phase difference relations for different orientations may be used to determine the direction of the d-vector in the spin-triplet superconductor.