mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
23 lines
522 B
Dart
23 lines
522 B
Dart
import 'package:hive/hive.dart';
|
|
import 'package:PiliPalaX/http/user.dart';
|
|
|
|
import 'storage.dart';
|
|
|
|
class Data {
|
|
static Future init() async {
|
|
await historyStatus();
|
|
}
|
|
|
|
static Future historyStatus() async {
|
|
Box localCache = GStorage.localCache;
|
|
Box userInfoCache = GStorage.userInfo;
|
|
if (userInfoCache.get('userInfoCache') == null) {
|
|
return;
|
|
}
|
|
var res = await UserHttp.historyStatus();
|
|
if (res['status']) {
|
|
localCache.put(LocalCacheKey.historyPause, res['data']);
|
|
}
|
|
}
|
|
}
|