fix login dialog can't pop when api server is invalid

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-06-15 15:28:53 +08:00
parent 957e23fa82
commit 5a14945666

View File

@ -133,9 +133,9 @@ class UserModel {
}
static Future<List<dynamic>> queryLoginOptions() async {
final url = await bind.mainGetApiServer();
final resp = await http.get(Uri.parse('$url/api/login-options'));
try {
final url = await bind.mainGetApiServer();
final resp = await http.get(Uri.parse('$url/api/login-options'));
return jsonDecode(resp.body);
} catch (e) {
print("queryLoginOptions: jsonDecode resp body failed: ${e.toString()}");