mod: 本地缓存字段修改、登录状态

This commit is contained in:
guozhigq
2023-08-20 14:28:50 +08:00
parent 8627869309
commit 83341cd62b
29 changed files with 217 additions and 167 deletions

View File

@ -11,17 +11,19 @@ class BangumiController extends GetxController {
RxList<BangumiListItemModel> bangumiFollowList = [BangumiListItemModel()].obs;
int _currentPage = 1;
bool isLoadingMore = true;
Box user = GStrorage.user;
Box userInfoCache = GStrorage.userInfo;
RxBool userLogin = false.obs;
late int mid;
var userInfo;
@override
void onInit() {
super.onInit();
if (user.get(UserBoxKey.userMid) != null) {
mid = int.parse(user.get(UserBoxKey.userMid).toString());
userInfo = userInfoCache.get('userInfoCache');
if (userInfo != null) {
mid = userInfo.mid;
}
userLogin.value = user.get(UserBoxKey.userLogin) != null;
userLogin.value = userInfo != null;
}
Future queryBangumiListFeed({type = 'init'}) async {