Example 1 As shown, in Rt $\triangle ABC$, the hypotenuse $AB=5, CD \perp AB$. It is known that $BC, AC$ are the two roots of the quadratic equation $x^{2}-(2 m-1) x+4(m-1)=0$. Then the value of $m$ is $\qquad$.
Solution: Let $A C=b$, $B C=a$. By Vieta's formulas, we get $a+b=2 m-$
$$
\begin{array}{l}
1, a b=4(m-1) . \\
\begin{aligned}
\therefore A B^{2} & =a^{2}+b^{2}=(a+b)^{2}-2 a b \\
& =(2 m-1)^{2}-2 \times 4(m-1)=5^{2},
\end{aligned}
\end{array}
$$

i.e., $m^{2}-3 m-4=0$.
$$
\therefore m=4 \text { or } m=-1 \text {. }
$$

Since $a$ and $b$ are the lengths of the sides of a triangle, we have $a>0, b>0$. Therefore, $a+b=2 m-1>0$, i.e., $m>\frac{1}{2}$.
$$
\therefore m=4 \text {. }
$$