mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 12:34:45 +08:00
拆分 AppConf
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:starcitizen_doctor/common/conf.dart';
|
||||
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
|
||||
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
|
||||
|
||||
class AnalyticsApi {
|
||||
@ -11,7 +11,7 @@ class AnalyticsApi {
|
||||
if (kDebugMode) return;
|
||||
dPrint("AnalyticsApi.touch === $key start");
|
||||
try {
|
||||
await _dio.post("${AppConf.xkeycApiUrl}/analytics/$key");
|
||||
await _dio.post("${URLConf.xkeycApiUrl}/analytics/$key");
|
||||
dPrint("AnalyticsApi.touch === $key over");
|
||||
} catch (e) {
|
||||
dPrint("AnalyticsApi.touch === $key Error:$e");
|
||||
|
@ -1,7 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:starcitizen_doctor/common/conf.dart';
|
||||
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
|
||||
import 'package:starcitizen_doctor/data/app_placard_data.dart';
|
||||
import 'package:starcitizen_doctor/data/app_version_data.dart';
|
||||
import 'package:starcitizen_doctor/data/countdown_festival_item_data.dart';
|
||||
@ -37,7 +37,7 @@ class Api {
|
||||
static Future<Map<String, dynamic>> getAppReleaseDataByVersionName(
|
||||
String version) async {
|
||||
final r = await dio
|
||||
.get("${AppConf.gitlabApiPath}/repos/SCToolBox/Release/releases/tags/$version");
|
||||
.get("${URLConf.gitlabApiPath}/repos/SCToolBox/Release/releases/tags/$version");
|
||||
return r.data;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ class Api {
|
||||
}
|
||||
|
||||
static Future getRepoData(String dir, String name) async {
|
||||
final r = await dio.get("${AppConf.apiRepoPath}/$dir/$name");
|
||||
final r = await dio.get("${URLConf.apiRepoPath}/$dir/$name");
|
||||
return r.data;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:dart_rss/dart_rss.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:starcitizen_doctor/common/conf.dart';
|
||||
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
|
||||
|
||||
class RSSApi {
|
||||
static final _dio = Dio(BaseOptions(
|
||||
@ -10,15 +10,15 @@ class RSSApi {
|
||||
responseType: ResponseType.plain));
|
||||
|
||||
static Future<List<RssItem>> getRssVideo() async {
|
||||
final r = await _dio.get(AppConf.rssVideoUrl);
|
||||
final r = await _dio.get(URLConf.rssVideoUrl);
|
||||
final f = RssFeed.parse(r.data);
|
||||
return f.items.sublist(0, 8);
|
||||
}
|
||||
|
||||
static Future<List<RssItem>> getRssText() async {
|
||||
final r1 = await _dio.get(AppConf.rssTextUrl1);
|
||||
final r1 = await _dio.get(URLConf.rssTextUrl1);
|
||||
final r1f = RssFeed.parse(r1.data);
|
||||
final r2 = await _dio.get(AppConf.rssTextUrl2);
|
||||
final r2 = await _dio.get(URLConf.rssTextUrl2);
|
||||
final r2f = RssFeed.parse(r2.data);
|
||||
final items = r1f.items..addAll(r2f.items);
|
||||
items.sort((a, b) {
|
||||
|
Reference in New Issue
Block a user