fix logout
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
6a500f2ede
commit
7692dcd629
@ -1006,7 +1006,7 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin {
|
|||||||
|
|
||||||
final newApiServer = await bind.mainGetApiServer();
|
final newApiServer = await bind.mainGetApiServer();
|
||||||
if (oldApiServer.isNotEmpty && oldApiServer != newApiServer) {
|
if (oldApiServer.isNotEmpty && oldApiServer != newApiServer) {
|
||||||
await gFFI.userModel.logOut();
|
await gFFI.userModel.logOut(apiServer: oldApiServer);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -101,10 +101,10 @@ class UserModel {
|
|||||||
await Future.wait([gFFI.abModel.pullAb(), gFFI.groupModel.pull()]);
|
await Future.wait([gFFI.abModel.pullAb(), gFFI.groupModel.pull()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> logOut() async {
|
Future<void> logOut({String? apiServer}) async {
|
||||||
final tag = gFFI.dialogManager.showLoading(translate('Waiting'));
|
final tag = gFFI.dialogManager.showLoading(translate('Waiting'));
|
||||||
try {
|
try {
|
||||||
final url = await bind.mainGetApiServer();
|
final url = apiServer ?? await bind.mainGetApiServer();
|
||||||
final authHeaders = getHttpHeaders();
|
final authHeaders = getHttpHeaders();
|
||||||
authHeaders['Content-Type'] = "application/json";
|
authHeaders['Content-Type'] = "application/json";
|
||||||
await http
|
await http
|
||||||
|
Loading…
x
Reference in New Issue
Block a user