“yanghuaxuan” 3 лет назад
Родитель
Сommit
eb9d859cff
3 измененных файлов: 17 добавлений и 8 удалений
  1. +4
    -4
      .dart_tool/package_config.json
  2. +12
    -4
      lib/models/user/user_info_model_notifier.dart
  3. +1
    -0
      lib/zhiying_comm.dart

+ 4
- 4
.dart_tool/package_config.json Просмотреть файл

@@ -135,7 +135,7 @@
},
{
"name": "flutter_alibc",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/git/zhiying_flutter_alibc-9786cccfb44cd4b38f2ca3f1ff1dc139c4e09d61/",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/git/zhiying_flutter_alibc-f0974bf1ee4e647c00f749707017841dc3685436/",
"packageUri": "lib/",
"languageVersion": "2.1"
},
@@ -363,7 +363,7 @@
},
{
"name": "secverify",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/secverify-1.0.2",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/git/secverify-c8cf0485ed961de40dc2b514b7402c3e61916d48/",
"packageUri": "lib/",
"languageVersion": "2.1"
},
@@ -537,7 +537,7 @@
},
{
"name": "webview_flutter",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-1.0.7",
"packageUri": "lib/",
"languageVersion": "2.7"
},
@@ -560,7 +560,7 @@
"languageVersion": "2.1"
}
],
"generated": "2021-02-09T02:05:40.877904Z",
"generated": "2021-03-01T06:48:08.229099Z",
"generator": "pub",
"generatorVersion": "2.10.1"
}

+ 12
- 4
lib/models/user/user_info_model_notifier.dart Просмотреть файл

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';

import 'package:flutter/material.dart';
@@ -16,6 +17,7 @@ import 'package:zhiying_comm/util/shared_prefe_util.dart';
class UserInfoNotifier with ChangeNotifier {
/// 用户信息
static UserInfoModel _userInfo;
static bool reFresh=false;

static UserInfoModel get staitcUserInfo {
return _userInfo;
@@ -66,16 +68,22 @@ class UserInfoNotifier with ChangeNotifier {
void unLogin() async {
_userInfo = null;
// 清除缓存数据
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_TOKEN, null);
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_MOBILE, null);
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_USER_INFO, null);
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_TOKEN, '');
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_MOBILE, '');
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_USER_INFO, '');
// 退出淘宝登录
FlutterAlibc.loginOut();
// 退出QQ登录
MobUtil.cancelQQAuth();
// 退出微信登录
MobUtil.cancelWeChatAuth();
EventUtil.instance.fire(LogOut());
if(!reFresh){
reFresh=true;
Timer(Duration(milliseconds: 1000), (){
EventUtil.instance.fire(LogOut());
});
}

notifyListeners();
}



+ 1
- 0
lib/zhiying_comm.dart Просмотреть файл

@@ -43,4 +43,5 @@ export 'util/event_util/event_util.dart';
export 'util/event_util/login_success_event.dart';
export 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart';
export 'package:save_image/save_image.dart';
export 'package:zhiying_comm/pages/login_page/login_style_util.dart';


Загрузка…
Отмена
Сохранить