mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: custom horizontal member page
Closes #51 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -133,6 +133,9 @@ class GStorage {
|
||||
static bool get horizontalSeasonPanel =>
|
||||
setting.get(SettingBoxKey.horizontalSeasonPanel, defaultValue: false);
|
||||
|
||||
static bool get horizontalMemberPage =>
|
||||
setting.get(SettingBoxKey.horizontalMemberPage, defaultValue: false);
|
||||
|
||||
static List<double> get dynamicDetailRatio =>
|
||||
setting.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]);
|
||||
|
||||
@@ -332,6 +335,7 @@ class SettingBoxKey {
|
||||
alwaysExapndIntroPanel = 'alwaysExapndIntroPanel',
|
||||
exapndIntroPanelH = 'exapndIntroPanelH',
|
||||
horizontalSeasonPanel = 'horizontalSeasonPanel',
|
||||
horizontalMemberPage = 'horizontalMemberPage',
|
||||
|
||||
// Sponsor Block
|
||||
enableSponsorBlock = 'enableSponsorBlock',
|
||||
|
||||
@@ -27,10 +27,27 @@ import 'package:path_provider/path_provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:webview_cookie_manager/webview_cookie_manager.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart' as web;
|
||||
import 'package:html/dom.dart' as dom;
|
||||
import 'package:html/parser.dart' as html_parser;
|
||||
|
||||
class Utils {
|
||||
static final Random random = Random();
|
||||
|
||||
static Future<dynamic> getWwebid(mid) async {
|
||||
try {
|
||||
dynamic response =
|
||||
await Request().get('${HttpString.spaceBaseUrl}/$mid/dynamic');
|
||||
dom.Document document = html_parser.parse(response.data);
|
||||
dom.Element? scriptElement =
|
||||
document.querySelector('script#__RENDER_DATA__');
|
||||
return jsonDecode(
|
||||
Uri.decodeComponent(scriptElement?.text ?? ''))['access_id'];
|
||||
} catch (e) {
|
||||
debugPrint('failed to get wwebid: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future afterLoginByApp(
|
||||
Map<String, dynamic> token_info, cookie_info) async {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user