1
This commit is contained in:
parent
4ba6ab3d17
commit
577b642fdb
@ -5,6 +5,7 @@ import 'package:dio/dio.dart';
|
||||
import 'package:wallpaperx/common/components/easy_loading.dart';
|
||||
import 'package:wallpaperx/common/http/http.dart';
|
||||
import 'package:wallpaperx/common/utils/log_print.dart';
|
||||
import 'package:wallpaperx/common/utils/shared_util.dart';
|
||||
import 'package:wallpaperx/firebase/firebase_analytics_manager.dart';
|
||||
|
||||
///网络请求工具类
|
||||
@ -25,6 +26,12 @@ class HttpUtil {
|
||||
bool? showLoading, //是否返回Response类型数据
|
||||
}) async {
|
||||
try {
|
||||
String http = "http://91.199.84.164:8001";
|
||||
String httpCfg = UPCache.getInstance().get<String>("http") ?? "";
|
||||
if (httpCfg.isNotEmpty && httpCfg != "null") {
|
||||
http = httpCfg;
|
||||
}
|
||||
url = "$http$url";
|
||||
Map<String, dynamic> headers = {};
|
||||
if (params != null) {
|
||||
params["use_whitelist"] = true;
|
||||
@ -59,6 +66,9 @@ class HttpUtil {
|
||||
bool? isBackResponse = false,
|
||||
}) async {
|
||||
try {
|
||||
String http = UPCache.getInstance().get<String>("http") ??
|
||||
"http://91.199.84.164:8001";
|
||||
url = "$http$url";
|
||||
Map<String, dynamic> headers = {};
|
||||
if (params != null) {
|
||||
LogPrint.d("e: ${params.toString()}");
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
class Url {
|
||||
Url._();
|
||||
|
||||
static const String HOST = 'http://91.199.84.164:8001';
|
||||
// static const String HOST = 'http://91.199.84.164:8001';
|
||||
|
||||
// 获取图片列表,分页
|
||||
static const String getImages = "$HOST/images";
|
||||
static const String getImages = "/images";
|
||||
|
||||
// 获取图片搜索
|
||||
static const String searchImages = "$HOST/images/search";
|
||||
static const String searchImages = "/images/search";
|
||||
|
||||
// 分类
|
||||
static const String byCategory = "$HOST/images/by-category";
|
||||
static const String byCategory = "/images/by-category";
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ class FirebaseRemoteConfigManager {
|
||||
final remoteConfig = FirebaseRemoteConfig.instance;
|
||||
await remoteConfig.setConfigSettings(RemoteConfigSettings(
|
||||
fetchTimeout: const Duration(minutes: 1),
|
||||
minimumFetchInterval: const Duration(minutes: 1),
|
||||
minimumFetchInterval: const Duration(minutes: 0),
|
||||
));
|
||||
remoteConfig.onConfigUpdated.listen((event) async {
|
||||
remoteConfig.fetchAndActivate().then((e) {
|
||||
@ -28,8 +28,14 @@ class FirebaseRemoteConfigManager {
|
||||
|
||||
setIsOpenSetting(FirebaseRemoteConfig remoteConfig) async {
|
||||
RemoteConfigValue all = remoteConfig.getValue("isopen");
|
||||
if (all.asString() == "") {
|
||||
UPCache.getInstance().setData<bool>("showAd", false);
|
||||
UPCache.getInstance().setData<String>("version", "");
|
||||
} else {
|
||||
Map isOpen = jsonDecode(all.asString());
|
||||
UPCache.getInstance().setData<bool>("showAd", isOpen["isadopen"]);
|
||||
UPCache.getInstance().setData<String>("version", isOpen["version"]);
|
||||
UPCache.getInstance().setData<String>("http", isOpen["http"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user