fix logOut fail, add logOut request timeout and catch err
This commit is contained in:
parent
1054715891
commit
c67b952869
@ -79,12 +79,16 @@ class UserModel {
|
|||||||
final tag = gFFI.dialogManager.showLoading(translate('Waiting'));
|
final tag = gFFI.dialogManager.showLoading(translate('Waiting'));
|
||||||
try {
|
try {
|
||||||
final url = await bind.mainGetApiServer();
|
final url = await bind.mainGetApiServer();
|
||||||
final _ = await http.post(Uri.parse('$url/api/logout'),
|
await http
|
||||||
body: {
|
.post(Uri.parse('$url/api/logout'),
|
||||||
'id': await bind.mainGetMyId(),
|
body: {
|
||||||
'uuid': await bind.mainGetUuid(),
|
'id': await bind.mainGetMyId(),
|
||||||
},
|
'uuid': await bind.mainGetUuid(),
|
||||||
headers: await getHttpHeaders());
|
},
|
||||||
|
headers: await getHttpHeaders())
|
||||||
|
.timeout(Duration(seconds: 2));
|
||||||
|
} catch (e) {
|
||||||
|
print("request /api/logout failed: err=$e");
|
||||||
} finally {
|
} finally {
|
||||||
await reset();
|
await reset();
|
||||||
gFFI.dialogManager.dismissByTag(tag);
|
gFFI.dialogManager.dismissByTag(tag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user