endless loop in login by nextcloud app on Mi 11

I can’t see the logs.
But on all nextcloud related apps, the login is endlessly…
Besides, on Windows 10, the nextcloud desktop software can not login either, the error is listed below:

访问 token 端点时出错:connection refused

When I copy the link, it is

https://localhost:8001/login/v2/flow

This seems terrible.
However, I am able to use nextcloud normally by web on both mobile and computer.