fix: 增加iap的跳转
This commit is contained in:
@@ -299,6 +299,42 @@ class KRSiteConfigService extends ChangeNotifier {
|
||||
return _siteConfig?.site.deviceLimit ?? '0';
|
||||
}
|
||||
|
||||
/// 获取当前版本号
|
||||
///
|
||||
/// 功能:从站点配置的 customData 中解析并返回 curVersion
|
||||
/// 参数:无
|
||||
/// 返回:String 当前版本号,如未配置返回空字符串
|
||||
String getCurVersion() {
|
||||
try {
|
||||
final customData = _siteConfig?.site.customData ?? '';
|
||||
if (customData.isEmpty) return '';
|
||||
final Map<String, dynamic> jsonMap =
|
||||
jsonDecode(customData) as Map<String, dynamic>;
|
||||
final value = jsonMap['curVersion'];
|
||||
return value == null ? '' : value.toString();
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/// 获取分享地址
|
||||
///
|
||||
/// 功能:从站点配置的 customData 中解析并返回 shareUrl
|
||||
/// 参数:无
|
||||
/// 返回:String 分享地址,如未配置返回空字符串
|
||||
String getShareUrl() {
|
||||
try {
|
||||
final customData = _siteConfig?.site.customData ?? '';
|
||||
if (customData.isEmpty) return '';
|
||||
final Map<String, dynamic> jsonMap =
|
||||
jsonDecode(customData) as Map<String, dynamic>;
|
||||
final value = jsonMap['shareUrl'];
|
||||
return value == null ? '' : value.toString();
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/// 重置配置
|
||||
void reset() {
|
||||
_siteConfig = null;
|
||||
|
||||
Reference in New Issue
Block a user