后台登录一直302
Closed this issue · 3 comments
0x7c6 commented
ichynul commented
扩展配置的force_login_in_top
用于控制登录超时以后的页面跳转,为true
则整体跳转,所有已打开的tab都不在了,反之则是触发超时的那个tab跳转登录,登录成功以后所有tab可以继续操作。
你贴的这段代码,如果force_login_in_top
为true
,会给登录页面的控制器(默认为Encore\Admin\Controllers\AuthController
)加一个middleware
,而这个middleware
会把浏览器整体跳转登录:
iframe-tabs/src/Middleware/ForceLogin.php
Line 29 in 7534521
if (window != top) {
top.location.reload();
document.querySelector('body').innerHTML =
'<div style="background:#fff;z-index:999;padding-top:88px;position:fixed;top:0px;height:10000px;width:100%;text-align:center;font-size:18px;"><p>{$message}</p></div>';
if(!!(window.attachEvent && !window.opera)){
document.execCommand("stop");
}
else {
window.stop();
}
}
建议你把本扩展的force_login_in_top
设置为fase
试一下,或者禁用本扩展试一下,以便确认是这个扩展导致的问题。
ichynul commented
修改一下laravel-admin的配置admin.php
也许可以解决:
//....
'auth' => [
// 'controller' => App\Admin\Controllers\AuthController::class, //laravel-admin默认的登录控制器
'controller' => Encore\James\JamesController::class, //login-captcha的登录控制器
'guard' => 'admin',
'guards' => [
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
],
'providers' => [
'admin' => [
'driver' => 'eloquent',
'model' => Encore\Admin\Auth\Database\Administrator::class,
],
],
// Add "remember me" to login form
'remember' => true,
// Redirect to the specified URI when user is not authorized.
'redirect_to' => 'auth/login',
// The URIs that should be excluded from authorization.
'excepts' => [
'auth/login',
'auth/logout',
],
],
//....
0x7c6 commented
谢谢大佬