feat: 配置 WebView 数据目录,优化 WebView 性能;更新 homeUrl 方法以支持更好的 URL 生成逻辑

This commit is contained in:
Booker
2026-05-26 19:17:15 +07:00
parent ca25c2d706
commit 48e4229cb7
3 changed files with 29 additions and 5 deletions

View File

@@ -38,10 +38,13 @@ class AppConfig {
static String _normalizeHomeUrl(String host) {
final value = host.trim();
if (value.startsWith('http://') || value.startsWith('https://')) {
return value.endsWith('/') ? value : '$value/';
}
return 'https://$value/';
final normalized =
value.startsWith('http://') || value.startsWith('https://')
? value
: 'https://$value';
final uri = Uri.parse(normalized);
final path = uri.path.isEmpty ? '/' : uri.path;
return uri.replace(path: path).toString();
}
static String _withShellBranding(