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

@ -14,16 +14,18 @@ class MemberController extends GetxController {
Map? userStat;
String? face;
String? heroTag;
Box user = GStrorage.user;
Box userInfoCache = GStrorage.userInfo;
late int ownerMid;
// 投稿列表
RxList<VListItemModel>? archiveList = [VListItemModel()].obs;
var userInfo;
@override
void onInit() {
super.onInit();
mid = int.parse(Get.parameters['mid']!);
ownerMid = user.get(UserBoxKey.userMid) ?? -1;
userInfo = userInfoCache.get('userInfoCache');
ownerMid = userInfo != null ? userInfo.mid : -1;
face = Get.arguments['face'] ?? '';
heroTag = Get.arguments['heroTag'] ?? '';
}
@ -57,7 +59,7 @@ class MemberController extends GetxController {
// 关注/取关up
Future actionRelationMod() async {
if (user.get(UserBoxKey.userMid) == null) {
if (userInfo == null) {
SmartDialog.showToast('账号未登录');
return;
}