The transistor is the core unit of digital integrated circuits, and its performance and integration are the main determinants of chip performance. With the continuous progress of nano-manufacturing technology and process, high power and heat consumption have become a major problem restricting the development of integrated circuits. Using topological insulators instead of traditional semiconductors, and the spin and valley degrees of freedom instead of charge as information carriers, to design and fabricate transistors, and the use of optical interconnections to replace metal interconnections between functional units, are effective solutions of the thermal power consumption problem of nano-integrated circuits. Based on the two-dimensional topological insulators-silicene and germanene, we theoretically propose a kind of optically controlled transistor suitable for spin bias. The effects of off-resonant circularly polarized light on the output currents of silicene and germanene transistors are calculated by using the non-equilibrium Green's function method. It is shown that the topological properties of silicene (germanene) and the output characteristics of drain current are controlled by the chirality and intensity of incident light. Under the coaction of weak left circularly polarized light and spin bias, the silicene transistors output pure spin current and fully polarized spin-up current. Under the action of strong field, the phase transition of the edge state of the silicene forms a band gap, the transistor is cut off, and the output current is almost zero. Different from the silicene transistor, the germanene transistor can obtain stable pure spin current under a weak light field, and output 100% polarized spin-down current under a strong field. By simultaneously applying off-resonant circularly polarized light of different chirality to the central device region, the germanene transistor can be turned off effectively by using the edge state phase transition induced by the polarized light field and the energy band mismatch caused by the local light field. The output poles of spin-dependent currents are almost equal for silicene and germanene transistors in the ON state, however, the breakdown voltage of the germanene transistor is significantly higher than that of the silicene transistor, and optically controlled germanene transistor can maintain effective operation at higher temperatures.