fix logout failed
This commit is contained in:
parent
733a43df07
commit
813b9ea79d
@ -80,13 +80,15 @@ 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 authHeaders = getHttpHeaders();
|
||||||
|
authHeaders['Content-Type'] = "application/json";
|
||||||
await http
|
await http
|
||||||
.post(Uri.parse('$url/api/logout'),
|
.post(Uri.parse('$url/api/logout'),
|
||||||
body: {
|
body: jsonEncode({
|
||||||
'id': await bind.mainGetMyId(),
|
'id': await bind.mainGetMyId(),
|
||||||
'uuid': await bind.mainGetUuid(),
|
'uuid': await bind.mainGetUuid(),
|
||||||
},
|
}),
|
||||||
headers: getHttpHeaders())
|
headers: authHeaders)
|
||||||
.timeout(Duration(seconds: 2));
|
.timeout(Duration(seconds: 2));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("request /api/logout failed: err=$e");
|
print("request /api/logout failed: err=$e");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user