记住登录小区问题 和 登录失败跳转页面问题

master
章文轩 3 years ago
parent cdcbc40c7d
commit bfe9b5ea9e

@ -50,6 +50,7 @@ class DataProvider extends ChangeNotifier {
_loginHistories.removeAt(_loginHistories.length - 1);
}
HiveStore.dataBox!.put('historyLogin', _loginHistories);
}
}
}

@ -36,7 +36,6 @@ class UserProvider extends ChangeNotifier {
///
logout() async {
await NetUtil().post(SAASAPI.login.logOut, showMessage: true);
WebSocketUtil().closeWebSocket();
NetUtil().logout();
_isLogin = false;

@ -1,5 +1,6 @@
// Flutter imports:
// Project imports:
import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/auth/other_login_page.dart';
import 'package:aku_new_community_manager/provider/user_provider.dart';
import 'package:aku_new_community_manager/style/app_style.dart';
@ -10,6 +11,7 @@ import 'package:aku_new_community_manager/ui/agreements/privacy_page.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_new_community_manager/utils/network/net_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@ -85,7 +87,8 @@ class _SettingsPageState extends State<SettingsPage> {
child: AkuMaterialButton(
radius: 8.w,
color: AppStyle.primaryColor,
onPressed: () {
onPressed: ()async {
await NetUtil().post(SAASAPI.login.logOut, showMessage: true);
userProvider.logout();
Get.offAll(() => OtherLoginPage());
},

@ -1,5 +1,6 @@
// Package imports:
import 'package:aku_new_community_manager/saas_models/login/china_region_model.dart';
import 'package:aku_new_community_manager/saas_models/login/community_model.dart';
import 'package:aku_new_community_manager/saas_models/login/history_login_model.dart';
import 'package:aku_new_community_manager/saas_models/login/picked_city_model.dart';
import 'package:flutter/foundation.dart';
@ -21,6 +22,8 @@ class HiveStore {
Hive.registerAdapter(ChinaRegionModelAdapter()); //HiveTypeId:3
Hive.registerAdapter(HistoryLoginModelAdapter()); //HiveTypeId:4
Hive.registerAdapter(PickedCityModelAdapter()); //HiveTypeId:6
Hive.registerAdapter(CommunityModelAdapter());//HiveTypeId:7
Hive.init(dir.path);
_appBox = await Hive.openBox('app');
_dataBox = await Hive.openBox('dataBox');

Loading…
Cancel
Save