opt.: use cdn as default

This commit is contained in:
lollipopkit
2024-03-09 17:43:15 +08:00
parent 519ca23556
commit 96a0b9cfd2
6 changed files with 10 additions and 46 deletions

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 793;
static const int build = 796;
static const String engine = "3.19.2";
static const String buildAt = "2024-03-08 15:18:32";
static const int modifications = 2;
static const String buildAt = "2024-03-09 16:45:22";
static const int modifications = 1;
static const int script = 40;
}

View File

@@ -1,5 +1,4 @@
abstract final class Urls {
static const resBase = 'https://res.lolli.tech/serverbox';
static const cdnBase = 'https://cdn.lolli.tech/serverbox';
static const myGithub = 'https://github.com/lollipopkit';
static const appHelp = '$myGithub/flutter_server_box#-help';

View File

@@ -1,14 +1,11 @@
import 'package:dio/dio.dart';
import 'package:toolbox/data/res/store.dart';
import '../model/app/update.dart';
import '../res/url.dart';
class AppService {
Future<AppUpdate> getUpdate() async {
final useCDN = Stores.setting.useCdn.fetch() == 1;
final resp =
await Dio().get('${useCDN ? Urls.cdnBase : Urls.resBase}/update.json');
final resp = await Dio().get('${Urls.cdnBase}/update.json');
return AppUpdate.fromJson(resp.data);
}
}

View File

@@ -251,11 +251,6 @@ class SettingStore extends PersistentStore {
/// when building traffic view on server tab
late final ignoreLocalNet = property('ignoreLocalNetIface', true);
/// Use cdn
/// It's recommended to use cdn for non-China users
/// 0: unset, 1: use, 2: not use
late final useCdn = property('useCdn', 0);
/// Index of terminal cursor type
late final termCursor =
property('termCursor', TerminalCursorType.block.index);