mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-08-16 18:46:22 +08:00
update RSHttp
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
|
||||
import 'package:starcitizen_doctor/common/rust/api/http_api.dart' as rust_http;
|
||||
import 'package:starcitizen_doctor/common/io/rs_http.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';
|
||||
@@ -33,9 +33,8 @@ class Api {
|
||||
|
||||
static Future<Map<String, dynamic>> getAppReleaseDataByVersionName(
|
||||
String version) async {
|
||||
final r = await rust_http.getString(
|
||||
url:
|
||||
"${URLConf.gitlabApiPath}/repos/SCToolBox/Release/releases/tags/$version");
|
||||
final r = await RSHttp.getText(
|
||||
"${URLConf.gitlabApiPath}/repos/SCToolBox/Release/releases/tags/$version");
|
||||
return json.decode(r);
|
||||
}
|
||||
|
||||
@@ -52,8 +51,8 @@ class Api {
|
||||
}
|
||||
|
||||
static Future<List> getScServerStatus() async {
|
||||
final r = await rust_http.getString(
|
||||
url: "https://status.robertsspaceindustries.com/index.json");
|
||||
final r = await RSHttp.getText(
|
||||
"https://status.robertsspaceindustries.com/index.json");
|
||||
final map = json.decode(r);
|
||||
return map["systems"];
|
||||
}
|
||||
@@ -65,8 +64,7 @@ class Api {
|
||||
}
|
||||
|
||||
static Future<String> getRepoData(String dir, String name) async {
|
||||
final r =
|
||||
await rust_http.getString(url: "${URLConf.apiRepoPath}/$dir/$name");
|
||||
final r = await RSHttp.getText("${URLConf.apiRepoPath}/$dir/$name");
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user