Merge branch 'fix'
This commit is contained in:
@ -1,6 +1,12 @@
|
||||
PODS:
|
||||
- appscheme (1.0.4):
|
||||
- Flutter
|
||||
- audio_service (0.0.1):
|
||||
- Flutter
|
||||
- audio_session (0.0.1):
|
||||
- Flutter
|
||||
- auto_orientation (0.0.1):
|
||||
- Flutter
|
||||
- connectivity_plus (0.0.1):
|
||||
- Flutter
|
||||
- ReachabilitySwift
|
||||
@ -56,6 +62,9 @@ PODS:
|
||||
|
||||
DEPENDENCIES:
|
||||
- appscheme (from `.symlinks/plugins/appscheme/ios`)
|
||||
- audio_service (from `.symlinks/plugins/audio_service/ios`)
|
||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
@ -88,6 +97,12 @@ SPEC REPOS:
|
||||
EXTERNAL SOURCES:
|
||||
appscheme:
|
||||
:path: ".symlinks/plugins/appscheme/ios"
|
||||
audio_service:
|
||||
:path: ".symlinks/plugins/audio_service/ios"
|
||||
audio_session:
|
||||
:path: ".symlinks/plugins/audio_session/ios"
|
||||
auto_orientation:
|
||||
:path: ".symlinks/plugins/auto_orientation/ios"
|
||||
connectivity_plus:
|
||||
:path: ".symlinks/plugins/connectivity_plus/ios"
|
||||
device_info_plus:
|
||||
@ -135,6 +150,9 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
appscheme: b1c3f8862331cb20430cf9e0e4af85dbc1572ad8
|
||||
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
|
||||
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a
|
||||
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
|
@ -157,7 +157,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1300;
|
||||
LastUpgradeCheck = 1430;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1300"
|
||||
LastUpgradeVersion = "1430"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -9,7 +9,11 @@ class StyleString {
|
||||
}
|
||||
|
||||
class Constants {
|
||||
static const String appKey = '27eb53fc9058f8c3';
|
||||
// 27eb53fc9058f8c3 移动端 Android
|
||||
// 4409e2ce8ffd12b8 TV端
|
||||
static const String appKey = '4409e2ce8ffd12b8';
|
||||
// 59b43e04ad6965f34319062b478f83dd TV端
|
||||
static const String appSec = '59b43e04ad6965f34319062b478f83dd';
|
||||
static const String thirdSign = '04224646d1fea004e79606d3b038c84a';
|
||||
static const String thirdApi =
|
||||
'https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png';
|
||||
|
@ -373,6 +373,18 @@ class Api {
|
||||
static const getWebKey =
|
||||
'https://passport.bilibili.com/x/passport-login/web/key';
|
||||
|
||||
/// cookie转access_key
|
||||
static const cookieToKey =
|
||||
'https://passport.bilibili.com/x/passport-tv-login/h5/qrcode/confirm';
|
||||
|
||||
/// 申请二维码(TV端)
|
||||
static const getTVCode =
|
||||
'https://passport.snm0516.aisee.tv/x/passport-tv-login/qrcode/auth_code';
|
||||
|
||||
///扫码登录(TV端)
|
||||
static const qrcodePoll =
|
||||
'https://passport.bilibili.com/x/passport-tv-login/qrcode/poll';
|
||||
|
||||
/// 置顶视频
|
||||
static const getTopVideoApi = '/x/space/top/arc';
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/constants.dart';
|
||||
import 'package:pilipala/http/index.dart';
|
||||
import 'package:pilipala/models/dynamics/result.dart';
|
||||
import 'package:pilipala/models/follow/result.dart';
|
||||
@ -8,6 +9,8 @@ import 'package:pilipala/models/member/coin.dart';
|
||||
import 'package:pilipala/models/member/info.dart';
|
||||
import 'package:pilipala/models/member/seasons.dart';
|
||||
import 'package:pilipala/models/member/tags.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
import 'package:pilipala/utils/wbi_sign.dart';
|
||||
|
||||
class MemberHttp {
|
||||
@ -359,4 +362,89 @@ class MemberHttp {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 获取TV authCode
|
||||
static Future getTVCode() async {
|
||||
SmartDialog.showLoading();
|
||||
var params = {
|
||||
'appkey': Constants.appKey,
|
||||
'local_id': '0',
|
||||
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),
|
||||
};
|
||||
String sign = Utils.appSign(
|
||||
params,
|
||||
Constants.appKey,
|
||||
Constants.appSec,
|
||||
);
|
||||
var res = await Request()
|
||||
.post(Api.getTVCode, queryParameters: {...params, 'sign': sign});
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data']['auth_code'],
|
||||
'msg': '操作成功'
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 获取access_key
|
||||
static Future cookieToKey() async {
|
||||
var authCodeRes = await getTVCode();
|
||||
if (authCodeRes['status']) {
|
||||
var res = await Request().post(Api.cookieToKey, queryParameters: {
|
||||
'auth_code': authCodeRes['data'],
|
||||
'build': 708200,
|
||||
'csrf': await Request.getCsrf(),
|
||||
});
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
qrcodePoll(authCodeRes['data']);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': [], 'msg': '操作成功'};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Future qrcodePoll(authCode) async {
|
||||
var params = {
|
||||
'appkey': Constants.appKey,
|
||||
'auth_code': authCode.toString(),
|
||||
'local_id': '0',
|
||||
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),
|
||||
};
|
||||
String sign = Utils.appSign(
|
||||
params,
|
||||
Constants.appKey,
|
||||
Constants.appSec,
|
||||
);
|
||||
var res = await Request()
|
||||
.post(Api.qrcodePoll, queryParameters: {...params, 'sign': sign});
|
||||
SmartDialog.dismiss();
|
||||
if (res.data['code'] == 0) {
|
||||
String accessKey = res.data['data']['access_token'];
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
var userInfo = userInfoCache.get('userInfoCache');
|
||||
localCache.put(
|
||||
LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey});
|
||||
return {'status': true, 'data': [], 'msg': '操作成功'};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,6 @@ class _HistorySearchPageState extends State<HistorySearchPage> {
|
||||
onChoose: null,
|
||||
onUpdateMultiple: () => null,
|
||||
);
|
||||
;
|
||||
}
|
||||
},
|
||||
)
|
||||
|
@ -113,8 +113,8 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
MediaQuery.of(context).size.width * 9 / 16;
|
||||
localCache.put('sheetHeight', sheetHeight);
|
||||
localCache.put('statusBarHeight', statusBarHeight);
|
||||
return WillPopScope(
|
||||
onWillPop: () => _mainController.onBackPressed(context),
|
||||
return PopScope(
|
||||
onPopInvoked: (bool status) => _mainController.onBackPressed(context),
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
body: FadeTransition(
|
||||
|
@ -159,7 +159,6 @@ class _ImagePreviewState extends State<ImagePreview>
|
||||
_previewController.onChange(index),
|
||||
canScrollPage: (GestureDetails? gestureDetails) =>
|
||||
gestureDetails!.totalScale! <= 1.0,
|
||||
preloadPagesCount: 2,
|
||||
itemCount: widget.imgList!.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return ExtendedImage.network(
|
||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/member.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class PrivacySetting extends StatefulWidget {
|
||||
@ -53,6 +54,16 @@ class _PrivacySettingState extends State<PrivacySetting> {
|
||||
title: Text('黑名单管理', style: titleStyle),
|
||||
subtitle: Text('已拉黑用户', style: subTitleStyle),
|
||||
),
|
||||
ListTile(
|
||||
onTap: () {
|
||||
if (!userLogin) {
|
||||
SmartDialog.showToast('请先登录');
|
||||
}
|
||||
MemberHttp.cookieToKey();
|
||||
},
|
||||
dense: false,
|
||||
title: Text('刷新access_key', style: titleStyle),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -2,8 +2,10 @@
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@ -297,4 +299,18 @@ class Utils {
|
||||
|
||||
return '$formattedHours:$formattedMinutes';
|
||||
}
|
||||
|
||||
static String appSign(
|
||||
Map<String, dynamic> params, String appkey, String appsec) {
|
||||
params['appkey'] = appkey;
|
||||
var searchParams = Uri(queryParameters: params).query;
|
||||
var sortedParams = searchParams.split('&')..sort();
|
||||
var sortedQueryString = sortedParams.join('&');
|
||||
|
||||
var appsecString = sortedQueryString + appsec;
|
||||
var md5Digest = md5.convert(utf8.encode(appsecString));
|
||||
var md5String = md5Digest.toString(); // 获取MD5哈希值
|
||||
|
||||
return md5String;
|
||||
}
|
||||
}
|
||||
|
22
pubspec.lock
22
pubspec.lock
@ -421,18 +421,18 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: extended_image
|
||||
sha256: e77d18f956649ba6e5ecebd0cb68542120886336a75ee673788145bd4c3f0767
|
||||
sha256: d7f091d068fcac7246c4b22a84b8dac59a62e04d29a5c172710c696e67a22f94
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.0.2"
|
||||
version: "8.2.0"
|
||||
extended_image_library:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: extended_image_library
|
||||
sha256: bb8d08c504ebc73d476ec1c99451a61f12e95538869e734fc4f55a3a2d5c98ec
|
||||
sha256: "9b55fc5ebc65fad984de66b8f177a1bef2a84d79203c9c213f75ff83c2c29edd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.5.3"
|
||||
version: "4.0.1"
|
||||
extended_list:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -551,10 +551,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360"
|
||||
sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.15"
|
||||
version: "2.0.17"
|
||||
flutter_smart_dialog:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -580,10 +580,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_volume_controller
|
||||
sha256: "1161957826183b46916adb4f1c9f91befce0d8415bd3fcd781f7faed9df62d46"
|
||||
sha256: "0f10cc759499cb6c3e152a8f6ff8e5ce385b99db7e1f586d1a29d8e6c11f4082"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -1138,10 +1138,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: saver_gallery
|
||||
sha256: "3131bba4257f69901437c0f1ebd692201ca5f34512d42667513a3802f1c171d1"
|
||||
sha256: "2657953427ebe5a3b2d08157d41587c01923ccce3f1a616d55082be7470f8530"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "3.0.1"
|
||||
screen_brightness:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1629,4 +1629,4 @@ packages:
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.2.0-194.0.dev <4.0.0"
|
||||
flutter: ">=3.10.0"
|
||||
flutter: ">=3.16.0"
|
||||
|
@ -49,8 +49,8 @@ dependencies:
|
||||
|
||||
# 图片
|
||||
cached_network_image: ^3.3.0
|
||||
extended_image: ^8.0.2
|
||||
saver_gallery: ^2.0.1
|
||||
extended_image: ^8.2.0
|
||||
saver_gallery: ^3.0.1
|
||||
|
||||
# 存储
|
||||
path_provider: ^2.1.1
|
||||
@ -94,7 +94,7 @@ dependencies:
|
||||
audio_session: ^0.1.16
|
||||
|
||||
# 音量、亮度、屏幕控制
|
||||
flutter_volume_controller: ^1.3.0
|
||||
flutter_volume_controller: ^1.3.1
|
||||
screen_brightness: ^0.2.2+1
|
||||
wakelock_plus: ^1.1.1
|
||||
universal_platform: ^1.0.0+1
|
||||
|
Reference in New Issue
Block a user