|
@@ -3,7 +3,9 @@ import 'package:domain/entity/home_module.dart';
|
|
import 'package:domain/entity/response/hotel_info_entity.dart';
|
|
import 'package:domain/entity/response/hotel_info_entity.dart';
|
|
import 'package:domain/repository/auth_repository.dart';
|
|
import 'package:domain/repository/auth_repository.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
+import 'package:plugin_basic/constants/app_constant.dart';
|
|
import 'package:plugin_basic/service/user_service.dart';
|
|
import 'package:plugin_basic/service/user_service.dart';
|
|
|
|
+import 'package:plugin_platform/engine/sp/sp_util.dart';
|
|
import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
import 'package:router/componentRouter/component_router_service.dart';
|
|
import 'package:router/componentRouter/component_router_service.dart';
|
|
import 'package:widgets/load_state_layout.dart';
|
|
import 'package:widgets/load_state_layout.dart';
|
|
@@ -80,12 +82,19 @@ class MainController extends GetxController {
|
|
//有数据,判断是刷新还是加载更多的数据
|
|
//有数据,判断是刷新还是加载更多的数据
|
|
state.datas.clear();
|
|
state.datas.clear();
|
|
|
|
|
|
- //根据Key筛选需要展示的模块
|
|
|
|
- for (var hotelInfo in list) {
|
|
|
|
- if (hotelInfo.key != null) {
|
|
|
|
- state.datas.addAll(_filterModulesByKey(hotelInfo.key!));
|
|
|
|
|
|
+ int? isAdmin = SPUtil.getInt(AppConstant.storageIsAdmin);
|
|
|
|
+ if (isAdmin == 1) {
|
|
|
|
+ //如果是管理员登录,根据Key筛选需要展示的模块
|
|
|
|
+ for (var hotelInfo in list) {
|
|
|
|
+ if (hotelInfo.key != null) {
|
|
|
|
+ state.datas.addAll(_filterModulesByKey(hotelInfo.key!));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ //如果只是签到签出模式,手动的添加模块
|
|
|
|
+ state.datas.addAll(_filterModulesByKey("sign"));
|
|
}
|
|
}
|
|
|
|
+
|
|
//更新状态
|
|
//更新状态
|
|
changeLoadingState(LoadState.State_Success);
|
|
changeLoadingState(LoadState.State_Success);
|
|
} else {
|
|
} else {
|