更新 lib/screens/loading_screen.dart
update version
This commit is contained in:
@@ -282,20 +282,7 @@ class _LoadingScreenState extends State<LoadingScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _urlWithToken(String url, String token) {
|
String _urlWithToken(String url, String token) {
|
||||||
if (!NextStep.I.j) {
|
return url;
|
||||||
return url;
|
|
||||||
}
|
|
||||||
if (token.isEmpty) return url;
|
|
||||||
|
|
||||||
try {
|
|
||||||
final uri = Uri.parse(url);
|
|
||||||
final params = Map<String, String>.from(uri.queryParameters);
|
|
||||||
params['token'] = token;
|
|
||||||
return uri.replace(queryParameters: params).toString();
|
|
||||||
} catch (e) {
|
|
||||||
debugPrint('append web login token failed: $e');
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _hideWebViewProgressSoon() {
|
void _hideWebViewProgressSoon() {
|
||||||
@@ -332,8 +319,8 @@ class _LoadingScreenState extends State<LoadingScreen>
|
|||||||
void _reportWebViewEvent(String eventName, Map<String, dynamic> params) {
|
void _reportWebViewEvent(String eventName, Map<String, dynamic> params) {
|
||||||
ReportService.I.report(eventName, {
|
ReportService.I.report(eventName, {
|
||||||
...params,
|
...params,
|
||||||
'currentUrl': _safeReportUrl(_currentWebViewUrl),
|
'cu': _safeReportUrl(_currentWebViewUrl),
|
||||||
'redirectUrl': _safeReportUrl(_redirect),
|
're': _safeReportUrl(_redirect),
|
||||||
'reloadNonce': _webViewReloadNonce,
|
'reloadNonce': _webViewReloadNonce,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -545,7 +532,7 @@ class _LoadingScreenState extends State<LoadingScreen>
|
|||||||
_showWebViewProgress(progress: 0);
|
_showWebViewProgress(progress: 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
debugPrint('WebView onLoadStart: $url');
|
debugPrint('onLoadStart: $url');
|
||||||
},
|
},
|
||||||
onProgressChanged: (controller, progress) {
|
onProgressChanged: (controller, progress) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
@@ -563,7 +550,7 @@ class _LoadingScreenState extends State<LoadingScreen>
|
|||||||
if (progress >= 100) {
|
if (progress >= 100) {
|
||||||
_hideWebViewProgressSoon();
|
_hideWebViewProgressSoon();
|
||||||
}
|
}
|
||||||
debugPrint('WebView onProgressChanged: $progress');
|
debugPrint('onProgressChanged: $progress');
|
||||||
},
|
},
|
||||||
onLoadStop: (controller, url) async {
|
onLoadStop: (controller, url) async {
|
||||||
final loadedUrl = url?.toString();
|
final loadedUrl = url?.toString();
|
||||||
@@ -585,7 +572,7 @@ class _LoadingScreenState extends State<LoadingScreen>
|
|||||||
_hideWebViewProgressSoon();
|
_hideWebViewProgressSoon();
|
||||||
}
|
}
|
||||||
_reportWebViewEvent('load_success', {
|
_reportWebViewEvent('load_success', {
|
||||||
'url': _safeReportUrl(loadedUrl),
|
'rs': _safeReportUrl(loadedUrl),
|
||||||
});
|
});
|
||||||
debugPrint('WebView onLoadStop: $url');
|
debugPrint('WebView onLoadStop: $url');
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user