Example 3 Let $a \in \mathbf{R}$, and the function $f(x)=a x^{2}-2 x-2 a$. If the solution set of $f(x)>0$ is $A, B=\{x \mid 1<x<$ $3\}, A \cap B \neq \varnothing$, find the range of real number $a$.
Given that $f(x)$ is a quadratic function, we know $a \neq 0$.
Let $f(x)=0$, solving for its two roots gives $x_{1}=\frac{1}{a}-\sqrt{2+\frac{1}{a^{2}}}, x_{2}=\frac{1}{a}+\sqrt{2+\frac{1}{a^{2}}}$.
From this, we know $x_{1}<0$ and $x_{2}>0$.
(i) When $a>0$, $A=\left\{x \mid x<x_{1} \text{ or } x>x_{2}\right\}$.
The necessary and sufficient condition for $A \cap B \neq \varnothing$ is $x_{2}<3$, which simplifies to $\frac{1}{a}+\sqrt{2+\frac{1}{a^{2}}}<3$. Solving this, we get $a>\frac{6}{7}$.
(ii) When $a<0$, $A=\left\{x \mid x_{1}<x<x_{2}\right\}$.
The necessary and sufficient condition for $A \cap B \neq \varnothing$ is $x_{1}<1$, which simplifies to $\frac{1}{a}-\sqrt{2+\frac{1}{a^{2}}}<1$. Solving this, we get $a<-2$.
In summary, the range of $a$ for which $A \cap B=\varnothing$ is $(-\infty,-2) \cup\left(\frac{6}{7},+\infty\right)$.

When $a>0$, $f(x)$ opens upwards, and as long as $f(1)>0$ or $f(3)>0$, i.e., $a-2-2a>0$ or $9a-6-2a>0$, and given $a>0$, we solve to get $a>\frac{6}{7}$.

When $a<0$, $f(x)$ opens downwards, and we need $f(1)<0$ and $f(3)<0$, i.e., $a-2-2a>0$, solving this gives $a<-2$.
In summary, the range of $a$ for which $A \cap B=\varnothing$ is $(-\infty,-2) \cup\left(\frac{6}{7},+\infty\right)$.