refactor user login:

1. opt request json type.
2. desktop and mobile use same loginDialog.
3. opt loginDialog UI style.
4. opt login request Exception catch.
This commit is contained in:
csf
2023-01-06 19:26:19 +09:00
parent 1867502ef7
commit 3e357159f3
9 changed files with 363 additions and 321 deletions

View File

@@ -59,7 +59,7 @@ class GroupModel {
if (gFFI.userModel.isAdmin.isFalse)
'grp': gFFI.userModel.groupName.value,
});
final resp = await http.get(uri, headers: await getHttpHeaders());
final resp = await http.get(uri, headers: getHttpHeaders());
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
Map<String, dynamic> json = jsonDecode(resp.body);
if (json.containsKey('error')) {
@@ -110,7 +110,7 @@ class GroupModel {
'grp': gFFI.userModel.groupName.value,
'target_user': username
});
final resp = await http.get(uri, headers: await getHttpHeaders());
final resp = await http.get(uri, headers: getHttpHeaders());
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
Map<String, dynamic> json = jsonDecode(resp.body);
if (json.containsKey('error')) {