From ccbe25350e5d3c7f2a14ab8c427bb64a5d04ff41 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Wed, 13 Apr 2022 11:14:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=86=85=E7=BD=AE=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8headmap=E6=9C=AA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/login/WebViewLoginFragment.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt b/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt index 8d4d8ea9c..54775b50d 100644 --- a/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt +++ b/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt @@ -44,8 +44,10 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { if (!checking) { checking = true binding.titleBar.snackbar(R.string.check_host_cookie) - viewModel.source?.loginUrl?.let { - binding.webView.loadUrl(it) + viewModel.source?.let { source -> + source.loginUrl?.let { + binding.webView.loadUrl(it, source.getHeaderMap(true)) + } } } } @@ -57,9 +59,6 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { binding.webView.settings.apply { builtInZoomControls = true javaScriptEnabled = true - source.getHeaderMap()[AppConst.UA_NAME]?.let { - userAgentString = it - } } val cookieManager = CookieManager.getInstance() source.loginUrl?.let { @@ -82,7 +81,7 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { } } source.loginUrl?.let { - binding.webView.loadUrl(it) + binding.webView.loadUrl(it, source.getHeaderMap(true)) } }