opt history account

Closes #948

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-06 21:22:59 +08:00
parent eb9f3cd21c
commit f663301eae
8 changed files with 77 additions and 32 deletions

View File

@@ -16,6 +16,13 @@ class Accounts {
static final Map<AccountType, Account> accountMode = {};
static Account get main => accountMode[AccountType.main]!;
static Account get heartbeat => accountMode[AccountType.heartbeat]!;
static Account get history {
final heartbeat = Accounts.heartbeat;
if (heartbeat is AnonymousAccount) {
return Accounts.main;
}
return heartbeat;
}
// static set main(Account account) => set(AccountType.main, account);
static Future<void> init() async {

View File

@@ -29,13 +29,13 @@ class AccountManager extends Interceptor {
Api.heartBeat,
Api.historyReport,
Api.roomEntryAction,
Api.historyList,
Api.pauseHistory,
Api.clearHistory,
Api.delHistory,
Api.searchHistory,
Api.historyStatus,
Api.mediaListHistory,
// Api.historyList,
// Api.pauseHistory,
// Api.clearHistory,
// Api.delHistory,
// Api.searchHistory,
// Api.historyStatus,
// Api.mediaListHistory,
// progress
Api.pgcInfo,
Api.pugvInfo,

View File

@@ -5,7 +5,7 @@ import 'package:PiliPlus/utils/storage_key.dart';
class Data {
static Future<void> init() async {
if (!Accounts.main.isLogin) {
if (!Accounts.history.isLogin) {
return;
}
var res = await UserHttp.historyStatus();