mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
fix heartbeat
Closes #929 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -105,7 +105,7 @@ class UserHttp {
|
|||||||
queryParameters: {
|
queryParameters: {
|
||||||
'switch': switchStatus,
|
'switch': switchStatus,
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return res;
|
return res;
|
||||||
@@ -127,7 +127,7 @@ class UserHttp {
|
|||||||
Api.clearHistory,
|
Api.clearHistory,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return res;
|
return res;
|
||||||
@@ -210,7 +210,7 @@ class UserHttp {
|
|||||||
data: {
|
data: {
|
||||||
'kid': kidList.join(','),
|
'kid': kidList.join(','),
|
||||||
'jsonp': 'jsonp',
|
'jsonp': 'jsonp',
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
options: Options(
|
options: Options(
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
contentType: Headers.formUrlEncodedContentType,
|
||||||
|
|||||||
@@ -620,7 +620,7 @@ class VideoHttp {
|
|||||||
await Request().post(
|
await Request().post(
|
||||||
Api.roomEntryAction,
|
Api.roomEntryAction,
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
'room_id': roomId,
|
'room_id': roomId,
|
||||||
@@ -638,7 +638,7 @@ class VideoHttp {
|
|||||||
queryParameters: {
|
queryParameters: {
|
||||||
'aid': ?aid,
|
'aid': ?aid,
|
||||||
'type': ?type,
|
'type': ?type,
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -665,7 +665,7 @@ class VideoHttp {
|
|||||||
'type': videoType.type,
|
'type': videoType.type,
|
||||||
'sub_type': ?subType,
|
'sub_type': ?subType,
|
||||||
'played_time': progress,
|
'played_time': progress,
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -681,7 +681,7 @@ class VideoHttp {
|
|||||||
'desc': desc,
|
'desc': desc,
|
||||||
'oid': oid,
|
'oid': oid,
|
||||||
'upper_mid': upperMid,
|
'upper_mid': upperMid,
|
||||||
'csrf': Accounts.main.csrf,
|
'csrf': Accounts.heartbeat.csrf,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:PiliPlus/http/dynamics.dart';
|
|||||||
import 'package:PiliPlus/http/fav.dart';
|
import 'package:PiliPlus/http/fav.dart';
|
||||||
import 'package:PiliPlus/http/loading_state.dart';
|
import 'package:PiliPlus/http/loading_state.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/common/account_type.dart';
|
|
||||||
import 'package:PiliPlus/models/dynamics/article_content_model.dart'
|
import 'package:PiliPlus/models/dynamics/article_content_model.dart'
|
||||||
show ArticleContentModel;
|
show ArticleContentModel;
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
@@ -165,7 +164,7 @@ class ArticleController extends CommonDynController<MainListReply> {
|
|||||||
}
|
}
|
||||||
if (isLoaded.value) {
|
if (isLoaded.value) {
|
||||||
queryData();
|
queryData();
|
||||||
if (Accounts.get(AccountType.heartbeat).isLogin && !Pref.historyPause) {
|
if (Accounts.heartbeat.isLogin && !Pref.historyPause) {
|
||||||
VideoHttp.historyReport(aid: commentId, type: 5);
|
VideoHttp.historyReport(aid: commentId, type: 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:PiliPlus/common/widgets/text_field/controller.dart';
|
|||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
import 'package:PiliPlus/http/live.dart';
|
import 'package:PiliPlus/http/live.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/common/account_type.dart';
|
|
||||||
import 'package:PiliPlus/models/common/video/live_quality.dart';
|
import 'package:PiliPlus/models/common/video/live_quality.dart';
|
||||||
import 'package:PiliPlus/models_new/live/live_dm_info/data.dart';
|
import 'package:PiliPlus/models_new/live/live_dm_info/data.dart';
|
||||||
import 'package:PiliPlus/models_new/live/live_room_info_h5/data.dart';
|
import 'package:PiliPlus/models_new/live/live_room_info_h5/data.dart';
|
||||||
@@ -63,7 +62,7 @@ class LiveRoomController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
queryLiveUrl();
|
queryLiveUrl();
|
||||||
queryLiveInfoH5();
|
queryLiveInfoH5();
|
||||||
if (Accounts.get(AccountType.heartbeat).isLogin && !Pref.historyPause) {
|
if (Accounts.heartbeat.isLogin && !Pref.historyPause) {
|
||||||
VideoHttp.roomEntryAction(roomId: roomId);
|
VideoHttp.roomEntryAction(roomId: roomId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ class MineController
|
|||||||
|
|
||||||
Rx<ThemeType> themeType = ThemeType.system.obs;
|
Rx<ThemeType> themeType = ThemeType.system.obs;
|
||||||
static RxBool anonymity =
|
static RxBool anonymity =
|
||||||
(Accounts.account.isNotEmpty &&
|
(Accounts.account.isNotEmpty && !Accounts.heartbeat.isLogin).obs;
|
||||||
!Accounts.get(AccountType.heartbeat).isLogin)
|
|
||||||
.obs;
|
|
||||||
ThemeType get nextThemeType =>
|
ThemeType get nextThemeType =>
|
||||||
ThemeType.values[(themeType.value.index + 1) % ThemeType.values.length];
|
ThemeType.values[(themeType.value.index + 1) % ThemeType.values.length];
|
||||||
|
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ class PlPlayerController {
|
|||||||
// 添加一个私有构造函数
|
// 添加一个私有构造函数
|
||||||
PlPlayerController._({bool isLive = false}) {
|
PlPlayerController._({bool isLive = false}) {
|
||||||
_isLive = isLive;
|
_isLive = isLive;
|
||||||
if (!Accounts.get(AccountType.heartbeat).isLogin || Pref.historyPause) {
|
if (!Accounts.heartbeat.isLogin || Pref.historyPause) {
|
||||||
enableHeart = false;
|
enableHeart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class Accounts {
|
|||||||
static late final Box<LoginAccount> account;
|
static late final Box<LoginAccount> account;
|
||||||
static final Map<AccountType, Account> accountMode = {};
|
static final Map<AccountType, Account> accountMode = {};
|
||||||
static Account get main => accountMode[AccountType.main]!;
|
static Account get main => accountMode[AccountType.main]!;
|
||||||
|
static Account get heartbeat => accountMode[AccountType.heartbeat]!;
|
||||||
// static set main(Account account) => set(AccountType.main, account);
|
// static set main(Account account) => set(AccountType.main, account);
|
||||||
|
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
|
|||||||
@@ -24,9 +24,23 @@ class AccountManager extends Interceptor {
|
|||||||
Api.videoIntro,
|
Api.videoIntro,
|
||||||
Api.replyList,
|
Api.replyList,
|
||||||
Api.replyReplyList,
|
Api.replyReplyList,
|
||||||
|
|
||||||
|
// history
|
||||||
Api.heartBeat,
|
Api.heartBeat,
|
||||||
Api.ab2c,
|
Api.historyReport,
|
||||||
|
Api.roomEntryAction,
|
||||||
|
Api.historyList,
|
||||||
|
Api.pauseHistory,
|
||||||
|
Api.clearHistory,
|
||||||
|
Api.delHistory,
|
||||||
|
Api.searchHistory,
|
||||||
|
Api.historyStatus,
|
||||||
|
Api.mediaListHistory,
|
||||||
|
// progress
|
||||||
Api.pgcInfo,
|
Api.pgcInfo,
|
||||||
|
Api.pugvInfo,
|
||||||
|
|
||||||
|
Api.ab2c,
|
||||||
Api.liveRoomInfo,
|
Api.liveRoomInfo,
|
||||||
Api.liveRoomInfoH5,
|
Api.liveRoomInfoH5,
|
||||||
Api.onlineTotal,
|
Api.onlineTotal,
|
||||||
@@ -53,6 +67,7 @@ class AccountManager extends Interceptor {
|
|||||||
Api.searchTrending,
|
Api.searchTrending,
|
||||||
Api.searchRecommend,
|
Api.searchRecommend,
|
||||||
},
|
},
|
||||||
|
// progress
|
||||||
AccountType.video: {
|
AccountType.video: {
|
||||||
Api.ugcUrl,
|
Api.ugcUrl,
|
||||||
Api.pgcUrl,
|
Api.pgcUrl,
|
||||||
|
|||||||
Reference in New Issue
Block a user