mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt account
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
20
lib/services/account_service.dart
Normal file
20
lib/services/account_service.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:PiliPlus/models/user/info.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart' show GStorage;
|
||||
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 = GStorage.userInfo.get('userInfoCache');
|
||||
mid = userInfo?.mid ?? 0;
|
||||
name = (userInfo?.uname ?? '').obs;
|
||||
face = (userInfo?.face ?? '').obs;
|
||||
isLogin = (userInfo != null).obs;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user