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
@@ -0,0 +1,22 @@
|
||||
/// 机台与 title server 都按 UTC+8 记录日期,客户端格式见
|
||||
/// `TimeManager.GetDateString` / `GetNowDateString`。
|
||||
library;
|
||||
|
||||
const Duration shanghaiOffset = Duration(hours: 8);
|
||||
|
||||
DateTime shanghaiNow() => DateTime.now().toUtc().add(shanghaiOffset);
|
||||
|
||||
DateTime shanghaiFromUnixSeconds(int seconds) =>
|
||||
DateTime.fromMillisecondsSinceEpoch(seconds * 1000, isUtc: true)
|
||||
.add(shanghaiOffset);
|
||||
|
||||
String _two(int value) => value.toString().padLeft(2, '0');
|
||||
|
||||
String formatDate(DateTime dt) =>
|
||||
'${dt.year}-${_two(dt.month)}-${_two(dt.day)}';
|
||||
|
||||
String formatDateTime(DateTime dt) =>
|
||||
'${formatDate(dt)} ${_two(dt.hour)}:${_two(dt.minute)}:${_two(dt.second)}';
|
||||
|
||||
/// `ToString("yyyy-MM-dd HH:mm:ss.f")`:秒后固定带一位小数。
|
||||
String formatPlayDateTime(DateTime dt) => '${formatDateTime(dt)}.0';
|
||||
Reference in new issue
Block a user