|
|
@ -44,8 +44,10 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { |
|
|
|
if (!checking) { |
|
|
|
if (!checking) { |
|
|
|
checking = true |
|
|
|
checking = true |
|
|
|
binding.titleBar.snackbar(R.string.check_host_cookie) |
|
|
|
binding.titleBar.snackbar(R.string.check_host_cookie) |
|
|
|
viewModel.source?.loginUrl?.let { |
|
|
|
viewModel.source?.let { source -> |
|
|
|
binding.webView.loadUrl(it) |
|
|
|
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 { |
|
|
|
binding.webView.settings.apply { |
|
|
|
builtInZoomControls = true |
|
|
|
builtInZoomControls = true |
|
|
|
javaScriptEnabled = true |
|
|
|
javaScriptEnabled = true |
|
|
|
source.getHeaderMap()[AppConst.UA_NAME]?.let { |
|
|
|
|
|
|
|
userAgentString = it |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
val cookieManager = CookieManager.getInstance() |
|
|
|
val cookieManager = CookieManager.getInstance() |
|
|
|
source.loginUrl?.let { |
|
|
|
source.loginUrl?.let { |
|
|
@ -82,7 +81,7 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
source.loginUrl?.let { |
|
|
|
source.loginUrl?.let { |
|
|
|
binding.webView.loadUrl(it) |
|
|
|
binding.webView.loadUrl(it, source.getHeaderMap(true)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|