feat: 1.调整项目初始化,不用等待site/config接口,仅在hi_user_info中调用;将site_config_service拆成loadDomain和获取配置,在splash中只做loadDomain
2. 优化接口拦截的解密日志 3. 调整获取订阅到kr_home,与源版一致 4. 修复闪连抖动问题,增加套餐有效期判断
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import '../../utils/kr_log_util.dart';
|
||||
|
||||
@@ -41,7 +42,6 @@ class KRConfigData {
|
||||
/// 邀请链接
|
||||
final String kr_invitation_link;
|
||||
|
||||
final String kr_website_id;
|
||||
|
||||
KRConfigData({
|
||||
this.kr_config = '',
|
||||
@@ -56,16 +56,21 @@ class KRConfigData {
|
||||
this.kr_official_telegram = '',
|
||||
this.kr_official_telephone = '',
|
||||
this.kr_invitation_link = '',
|
||||
this.kr_website_id = '',
|
||||
}) : this.kr_domains = kr_domains ?? [],
|
||||
this.kr_update_application =
|
||||
kr_update_application ?? KRUpdateApplication();
|
||||
|
||||
factory KRConfigData.fromJson(Map<String, dynamic> json) {
|
||||
KRLogUtil.kr_e('配置数据: $json', tag: 'KRConfigData');
|
||||
KRLogUtil.kr_i('配置数据: $json', tag: 'KRConfigData');
|
||||
String _krConfigString = '';
|
||||
try {
|
||||
_krConfigString = jsonEncode(json);
|
||||
} catch (_) {
|
||||
_krConfigString = '';
|
||||
}
|
||||
return KRConfigData(
|
||||
kr_config: _krConfigString,
|
||||
kr_invitation_link: json['invitation_link'] ?? '',
|
||||
kr_config: json['kr_config'] ?? '',
|
||||
kr_encryption_key: json['encryption_key'] ?? '',
|
||||
kr_encryption_method: json['encryption_method'] ?? '',
|
||||
kr_domains: List<String>.from(json['domains'] ?? []),
|
||||
@@ -77,7 +82,6 @@ class KRConfigData {
|
||||
kr_official_website: json['official_website'] ?? '',
|
||||
kr_official_telegram: json['official_telegram'] ?? '',
|
||||
kr_official_telephone: json['official_telephone'] ?? '',
|
||||
kr_website_id: json['kr_website_id'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,17 +81,6 @@ class KRSiteInfo {
|
||||
String crispId = '0';
|
||||
String deviceLimit = '0';
|
||||
|
||||
// 尝试解析 custom_data 中的 kr_website_id
|
||||
try {
|
||||
final customDataStr = json['custom_data'] ?? '';
|
||||
if (customDataStr.isNotEmpty) {
|
||||
final customDataJson = jsonDecode(customDataStr) as Map<String, dynamic>;
|
||||
crispId = customDataJson['kr_website_id'] ?? '0';
|
||||
}
|
||||
} catch (e) {
|
||||
// 解析失败时使用默认值
|
||||
}
|
||||
|
||||
// 尝试解析 custom_data 中的 deviceLimit
|
||||
try {
|
||||
final customDataStr = json['custom_data'] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user