fix logout failed

This commit is contained in:
csf 2023-01-28 22:02:42 +09:00
parent 733a43df07
commit 813b9ea79d

View File

@ -80,13 +80,15 @@ class UserModel {
final tag = gFFI.dialogManager.showLoading(translate('Waiting'));
try {
final url = await bind.mainGetApiServer();
final authHeaders = getHttpHeaders();
authHeaders['Content-Type'] = "application/json";
await http
.post(Uri.parse('$url/api/logout'),
body: {
body: jsonEncode({
'id': await bind.mainGetMyId(),
'uuid': await bind.mainGetUuid(),
},
headers: getHttpHeaders())
}),
headers: authHeaders)
.timeout(Duration(seconds: 2));
} catch (e) {
print("request /api/logout failed: err=$e");