|
@@ -4,12 +4,14 @@ import 'dart:convert'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter_alibc/flutter_alibc.dart'; |
|
|
import 'package:flutter_alibc/flutter_alibc.dart'; |
|
|
import 'package:zhiying_comm/models/user/user_info_model.dart'; |
|
|
import 'package:zhiying_comm/models/user/user_info_model.dart'; |
|
|
|
|
|
import 'package:zhiying_comm/util/empty_util.dart'; |
|
|
import 'package:zhiying_comm/util/event_util/event_util.dart'; |
|
|
import 'package:zhiying_comm/util/event_util/event_util.dart'; |
|
|
import 'package:zhiying_comm/util/event_util/log_out.dart'; |
|
|
import 'package:zhiying_comm/util/event_util/log_out.dart'; |
|
|
import 'package:zhiying_comm/util/global_config.dart'; |
|
|
import 'package:zhiying_comm/util/global_config.dart'; |
|
|
import 'package:zhiying_comm/util/log/let_log.dart'; |
|
|
import 'package:zhiying_comm/util/log/let_log.dart'; |
|
|
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; |
|
|
import 'package:zhiying_comm/util/mob_util/mob_util.dart'; |
|
|
import 'package:zhiying_comm/util/shared_prefe_util.dart'; |
|
|
import 'package:zhiying_comm/util/shared_prefe_util.dart'; |
|
|
|
|
|
import 'package:zhiying_flutter_webview/zhiying_flutter_webview.dart'; |
|
|
|
|
|
|
|
|
/// |
|
|
/// |
|
|
/// 用户信息Provider |
|
|
/// 用户信息Provider |
|
@@ -62,6 +64,13 @@ class UserInfoNotifier with ChangeNotifier { |
|
|
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_MOBILE, loginUser.mobile); |
|
|
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_MOBILE, loginUser.mobile); |
|
|
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_USER_INFO, jsonEncode(loginUser.toJson())); |
|
|
await SharedPreferencesUtil.setStringValue(GlobalConfig.SHARED_KEY_USER_INFO, jsonEncode(loginUser.toJson())); |
|
|
FlutterAlibc.loginOut(); |
|
|
FlutterAlibc.loginOut(); |
|
|
|
|
|
// 设置H5的Token |
|
|
|
|
|
if(!EmptyUtil.isEmpty(loginUser?.token)) { |
|
|
|
|
|
String domain = await SharedPreferencesUtil.getStringValue(GlobalConfig.H5_DOMAIN); |
|
|
|
|
|
if (!EmptyUtil.isEmpty(domain)) { |
|
|
|
|
|
ZhiyingFlutterWebview.registLocalStore({'TOKEN_KEY': loginUser?.token}, [domain]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
notifyListeners(); |
|
|
notifyListeners(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -78,8 +87,13 @@ class UserInfoNotifier with ChangeNotifier { |
|
|
MobUtil.cancelQQAuth(); |
|
|
MobUtil.cancelQQAuth(); |
|
|
// 退出微信登录 |
|
|
// 退出微信登录 |
|
|
MobUtil.cancelWeChatAuth(); |
|
|
MobUtil.cancelWeChatAuth(); |
|
|
|
|
|
// 清除H5 Token |
|
|
|
|
|
String domain = await SharedPreferencesUtil.getStringValue(GlobalConfig.H5_DOMAIN); |
|
|
|
|
|
if (!EmptyUtil.isEmpty(domain)) { |
|
|
|
|
|
ZhiyingFlutterWebview.registLocalStore({'TOKEN_KEY': ''}, [domain]); |
|
|
|
|
|
} |
|
|
if(!reFresh){ |
|
|
if(!reFresh){ |
|
|
reFresh=true; |
|
|
|
|
|
|
|
|
reFresh = true; |
|
|
Timer(Duration(milliseconds: 1000), (){ |
|
|
Timer(Duration(milliseconds: 1000), (){ |
|
|
EventUtil.instance.fire(LogOut()); |
|
|
EventUtil.instance.fire(LogOut()); |
|
|
}); |
|
|
}); |
|
|