mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-29 20:24:27 +08:00
支持备线切换
This commit is contained in:
@ -113,11 +113,7 @@ class HomeUIModel extends BaseUIModel {
|
||||
.data));
|
||||
countdownFestivalListData = await Api.getFestivalCountdownList();
|
||||
notifyListeners();
|
||||
try {
|
||||
_loadRRS();
|
||||
} catch (e) {
|
||||
dPrint("_loadRRS Error:$e");
|
||||
}
|
||||
_loadRRS();
|
||||
} catch (e) {
|
||||
dPrint(e);
|
||||
}
|
||||
@ -139,6 +135,12 @@ class HomeUIModel extends BaseUIModel {
|
||||
appUpdateTimer = Timer.periodic(const Duration(minutes: 30), (timer) {
|
||||
_checkLocalizationUpdate();
|
||||
});
|
||||
Future.delayed(const Duration(milliseconds: 100)).then((value) {
|
||||
if (URLConf.isUsingFallback) {
|
||||
if (!mounted) return;
|
||||
showToast(context!, "因源服务器异常(机房故障或遭受攻击),当前正在使用备用线路,可能会出现访问速度下降,敬请谅解。");
|
||||
}
|
||||
});
|
||||
super.initModel();
|
||||
}
|
||||
|
||||
@ -187,13 +189,17 @@ class HomeUIModel extends BaseUIModel {
|
||||
}
|
||||
|
||||
Future _loadRRS() async {
|
||||
final v = await RSSApi.getRssVideo();
|
||||
rssVideoItems = v;
|
||||
notifyListeners();
|
||||
final t = await RSSApi.getRssText();
|
||||
rssTextItems = t;
|
||||
notifyListeners();
|
||||
dPrint("RSS update Success !");
|
||||
try {
|
||||
final v = await RSSApi.getRssVideo();
|
||||
rssVideoItems = v;
|
||||
notifyListeners();
|
||||
final t = await RSSApi.getRssText();
|
||||
rssTextItems = t;
|
||||
notifyListeners();
|
||||
dPrint("RSS update Success !");
|
||||
} catch (e) {
|
||||
dPrint("_loadRRS Error:$e");
|
||||
}
|
||||
}
|
||||
|
||||
VoidCallback? doCheck() {
|
||||
|
@ -207,7 +207,7 @@ class WebViewModel {
|
||||
|
||||
/// https://github.com/CxJuice/Uex_Chinese_Translate
|
||||
// get versions
|
||||
const hostUrl = URLConf.webTranslateHomeUrl;
|
||||
final hostUrl = URLConf.webTranslateHomeUrl;
|
||||
dPrint("AppWebLocalizationVersionsData === ${v.toJson()}");
|
||||
|
||||
localizationResource["zh-CN"] = await _getJson("$hostUrl/zh-CN-rsi.json",
|
||||
|
Reference in New Issue
Block a user