1. A method for controlling a gait-training apparatus using biofeedback, comprising steps of: a) detecting and analyzing an electromyographic signal of a user in the time domain and the frequency domain, and performing gait training on the gait-training apparatus by using a biosignal-detecting loop; b) driving the gait-training apparatus and determining the user's fatigue level by a feedback control loop, i) in the time domain, when the electromyographic signal reaches a threshold, the feedback control loop triggers a gait-generating loop to drive the gait-training apparatus; In the beginning, the threshold is an initial threshold; ii) in the frequency domain, the feedback control loop determines the fatigue level of the user's muscle during gait training based on the extent of median frequency shift; c) When the median frequency of the user's electromyographic signal is lower than an initial median frequency, the feedback control loop adjusts the threshold for triggering the gait-generating loop according to the extent of median frequency shift.