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

master
章文轩 3 years ago
parent cdcbc40c7d
commit bfe9b5ea9e

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

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

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

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

Loading…
Cancel
Save