x^2-(m^2+1)x+m-2=0
x1+x2=m^2+1,x1x2=m-2
(1+x1)(1+x2)=2,
x1+x2+x1x2+1=2
m^2+1+m-2+1=2
m^2+m-2=0
m= -2,或m=1