我试图在成功认证后重定向我的用户(使用 AJAX)。我试过使用window.location.href 和 document.location但没有成功。我也想保留饼干。
这是我的 Android 应用程序代码:
WebView myWebView = findViewById(R.id.mainView);
myWebView.loadUrl("http://192.168.100.5:3000/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
CookieManager.getInstance().setAcceptCookie(true);
myWebView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});