调整隐私政策和用户协议
This commit is contained in:
parent
1494e69b56
commit
8b4f38558f
|
|
@ -72,7 +72,7 @@ class _TheLoginState extends ConsumerState<TheLogin> with CommonMixin {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(Duration(seconds: 3), () => sysProtocol(context));
|
||||
Future.delayed(Duration(seconds: 2), () => sysProtocol(context));
|
||||
Future(() {
|
||||
// 延迟更新 Provider
|
||||
ref.read(userTokenProvider.notifier).clean(); // 进入登录页先清空信息
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import 'package:marking_app/pages/marking/index.dart';
|
|||
import 'package:marking_app/provider/user_provider.dart';
|
||||
import 'package:marking_app/utils/index.dart';
|
||||
import 'package:marking_app/utils/request/rest_client.dart';
|
||||
import 'package:marking_app/utils/sys_protocol.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
|
||||
import 'homework_correction/job_home.dart';
|
||||
|
|
@ -70,7 +69,6 @@ class TheMainPageState extends ConsumerState<TheMainPage> with CommonMixin {
|
|||
void initState() {
|
||||
_pageController = PageController(initialPage: tabIndex);
|
||||
_otherFocusNode = FocusNode();
|
||||
Future.delayed(Duration(seconds: 1), () => sysProtocol(context));
|
||||
// 由于本项目必须登录才能浏览,所以APP升级校验在登录后
|
||||
_userListener = ref.read(userProvider.notifier).addListener((state) {
|
||||
if (state.id != '0' && state.id != '') {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -41,6 +41,7 @@ class FastData {
|
|||
static const String _INPUT_KEYBOARD_GUIDE_PAGE_WORK = "APP:MARKING:GUIDE_PAGE:WORK";
|
||||
// 系统协议确认
|
||||
static const String _SYS_PROTOCOL = "APP:SYS:PROTOCOL";
|
||||
static const String _SYS_PROTOCOL_SHOW = "APP:SYS:PROTOCOL_SHOW";
|
||||
|
||||
static SharedPreferences? _prefs;
|
||||
|
||||
|
|
@ -286,4 +287,19 @@ class FastData {
|
|||
SharedPreferences thePrefs = await getSharedInstance();
|
||||
thePrefs.remove(_SYS_PROTOCOL);
|
||||
}
|
||||
|
||||
Future<bool> setSysProtocolShow(bool val) async {
|
||||
SharedPreferences thePrefs = await getSharedInstance();
|
||||
return await thePrefs.setBool(_SYS_PROTOCOL_SHOW, val);
|
||||
}
|
||||
|
||||
Future<bool?> getSysProtocolShow([SharedPreferences? thePrefs]) async {
|
||||
if (thePrefs == null) thePrefs = await getSharedInstance();
|
||||
return thePrefs.getBool(_SYS_PROTOCOL_SHOW);
|
||||
}
|
||||
|
||||
void cleanSysProtocolShow() async {
|
||||
SharedPreferences thePrefs = await getSharedInstance();
|
||||
thePrefs.remove(_SYS_PROTOCOL_SHOW);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class Protocol extends Dialog {
|
|||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
|
|
@ -122,17 +123,25 @@ class Protocol extends Dialog {
|
|||
}
|
||||
|
||||
/// 系统协议
|
||||
void sysProtocol(BuildContext context) async {
|
||||
Future<void> sysProtocol(BuildContext context) async {
|
||||
bool? _sysProtocol = await FastData.getInstance().getSysProtocol();
|
||||
if (_sysProtocol == null || !_sysProtocol) {
|
||||
print('进来这里....');
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (ctx) {
|
||||
return Protocol(ctx);
|
||||
},
|
||||
);
|
||||
bool? _sysProtocolShow = await FastData.getInstance().getSysProtocolShow();
|
||||
if (_sysProtocolShow != true) {
|
||||
try {
|
||||
await FastData.getInstance().setSysProtocolShow(true);
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
// useRootNavigator: false,
|
||||
builder: (ctx) => Protocol(ctx),
|
||||
);
|
||||
} catch (e) {
|
||||
FastData.getInstance().cleanSysProtocol();
|
||||
} finally {
|
||||
FastData.getInstance().cleanSysProtocolShow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue