refactor: 拆分主页与公共组件,扫码登录改走 WinHTTP
- 抽出 lib/core 的日期/JSON 工具,收敛各页重复解析 - 主页与音乐风险页拆成组件,风险功能共用一套运行框架 - 修复设置页作为主页页签保存时弹掉根路由导致的黑屏 - 登录对齐 Astral aimedb 协议:84 位二维码校验、签名与请求头修正, 补 GlobalSign 中间证书;Windows 改用 WinHTTP 绕过服务端对 BoringSSL 的 TLS 指纹拦截(证书校验保持开启) - 补开发预览数据与测试
This commit is contained in:
1 parent
0cb5320290
commit
e9357f5969
55 files changed
+4387
-3392
No files matched your search
@@ -6,6 +6,7 @@ import 'package:flutter/rendering.dart';
|
||||
import '../config/responsive.dart';
|
||||
import '../config/strings.dart';
|
||||
import '../config/title_server_config.dart';
|
||||
import '../models/session_model.dart';
|
||||
import '../models/user_rating.dart';
|
||||
import '../services/music_data_service.dart';
|
||||
import '../services/png_export_service.dart';
|
||||
@@ -56,7 +57,7 @@ class _Best50PageState extends State<Best50Page> {
|
||||
@override
|
||||
void didUpdateWidget(Best50Page oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
// 本页在 IndexedStack 里会先于 preview/登录请求被构建,cookies 到位后补一次加载。
|
||||
// 用户可能在 preview/登录请求完成前就切到本页,cookies 到位后再补一次加载。
|
||||
if (oldWidget.cookies != widget.cookies &&
|
||||
(_rating == null || _error != null)) {
|
||||
_bootstrap();
|
||||
@@ -75,7 +76,9 @@ class _Best50PageState extends State<Best50Page> {
|
||||
});
|
||||
|
||||
try {
|
||||
final service = TitleApiService.fromHolder(cookies: widget.cookies)!;
|
||||
final service = SessionModel.instance.createTitleService(
|
||||
cookies: widget.cookies,
|
||||
)!;
|
||||
final rating = await service.getUserRatingTyped(widget.userId);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
@@ -87,10 +90,8 @@ class _Best50PageState extends State<Best50Page> {
|
||||
await MusicDataService.instance.load();
|
||||
if (!mounted) return;
|
||||
setState(() => _musicReady = true);
|
||||
} on TitleApiException catch (e) {
|
||||
_fail(e.message);
|
||||
} catch (e) {
|
||||
_fail('$e');
|
||||
_fail(describeApiError(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user