书籍接口与界面

This commit is contained in:
DelLevin-Home
2026-06-24 19:51:35 +08:00
parent e4ed73d604
commit 5b7823cb78
20 changed files with 4552 additions and 361 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
import 'package:package_info_plus/package_info_plus.dart';
import 'server_config.dart';
/// 更新日志数据模型
class ChangelogItem {
@@ -29,7 +30,7 @@ class ChangelogItem {
/// 版本更新检查服务
class ChangelogService {
static const _apiUrl = 'https://api.mooknote.iletter.top/api/changelog';
static final _apiUrl = '${ServerConfig.apiBase}/changelog';
/// 获取更新日志列表
static Future<List<ChangelogItem>> fetchChangelog() async {
@@ -69,6 +70,7 @@ class ChangelogService {
final rest = s.substring(dot + 1).replaceAll('.', ''); // "19" 或 "188"
return double.tryParse('$major$rest') ?? 0;
}
final aVal = toNum(a);
final bVal = toNum(b);
debugPrint('[Update] compare: "$a"→$aVal vs "$b"→$bVal');