mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
21 lines
529 B
Dart
21 lines
529 B
Dart
import 'package:PiliPlus/models/user/info.dart';
|
|
import 'package:PiliPlus/utils/storage_pref.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class AccountService extends GetxService {
|
|
late int mid;
|
|
late final RxString name;
|
|
late final RxString face;
|
|
late final RxBool isLogin;
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
UserInfoData? userInfo = Pref.userInfoCache;
|
|
mid = userInfo?.mid ?? 0;
|
|
name = (userInfo?.uname ?? '').obs;
|
|
face = (userInfo?.face ?? '').obs;
|
|
isLogin = (userInfo != null).obs;
|
|
}
|
|
}
|