From 5703241449df4525217ac0c74322339c21411d98 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Thu, 27 May 2021 17:02:32 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81app=E4=B8=8EH5=E5=85=B1=E4=BA=ABtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/app_config_model.dart | 28 ++++++++++++++++++++++++++-- lib/register.dart | 4 ++++ pubspec.yaml | 5 ----- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/lib/models/app_config_model.dart b/lib/models/app_config_model.dart index 823f428..bfbc9d3 100644 --- a/lib/models/app_config_model.dart +++ b/lib/models/app_config_model.dart @@ -12,6 +12,9 @@ class AppConfigModel { // 引导页 AppConfigGuideModel guideImage; + // H5根域名 + DomainModel domain; + ///新引导页参数 GuideData guideData; @@ -19,7 +22,7 @@ class AppConfigModel { static AppConfigModel _config; - AppConfigModel({this.keys, this.guideImage}); + AppConfigModel({this.keys, this.guideImage, this.domain}); static AppConfigModel getConfig() => _config; @@ -55,6 +58,7 @@ class AppConfigModel { guideImage = json['guide_image'] != null ? new AppConfigGuideModel.fromJson(json['guide_image']) : null; guideData = json['guide_data'] != null ? GuideData.fromJson(json['guide_data']) : null; appStartDelay = json['app_start_delay'] != null ? json['app_start_delay'] : '0.5'; + domain = json['domain'] != null ? new DomainModel.fromJson(json['domain']) : null; } Map toJson() { @@ -65,6 +69,9 @@ class AppConfigModel { if (this.guideImage != null) { data['guide_image'] = this.guideImage.toJson(); } + if (this.domain != null) { + data['domain'] = this.domain.toJson(); + } return data; } } @@ -79,6 +86,7 @@ class AppConfigKeyModel { AppConfigKeyItemModel bugly; GDModel gd; + AppConfigKeyModel({this.weibo, this.qq, this.weixin, this.jdIos, this.jdAndroid, this.taobao, this.bugly}); AppConfigKeyModel.fromJson(Map json) { @@ -118,7 +126,6 @@ class AppConfigKeyModel { if (this.bugly != null) { data['bugly_list'] = this.bugly.toJson(); } - return data; } } @@ -261,6 +268,23 @@ class AppConfigGuideModel { } } +class DomainModel { + String h5Url; + + DomainModel({this.h5Url}); + + DomainModel.fromJson(Map json) { + h5Url = json['h5_url']?.toString(); + } + + Map toJson() { + final Map data = new Map(); + data['h5_url'] = this.h5Url; + return data; + } + +} + class GDModel { String androidKey; String iosKey; diff --git a/lib/register.dart b/lib/register.dart index 18104f6..0580f12 100644 --- a/lib/register.dart +++ b/lib/register.dart @@ -187,6 +187,10 @@ class BaseWidgetRegister { } } + // 缓存h5根域名, 用来与h5共享token等数据 + SharedPreferencesUtil.setStringValue(GlobalConfig.H5_DOMAIN, config?.domain?.h5Url ?? ''); + Logger.log('h5 根域名 = ' + config?.domain?.h5Url ?? ''); + }); return null; diff --git a/pubspec.yaml b/pubspec.yaml index bd95e5e..3d53b99 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -68,11 +68,6 @@ dependencies: url: http://192.168.0.138:3000/FnuoOS_ZhiYing/flutter_bugly.git # ath: ../flutter_bugly - zhiying_flutter_webview: - git: - url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_webview.git - ref: 0.0.4 - # 特效底部 # convex_bottom_bar: ^2.7.1+2