4
This commit is contained in:
@@ -31,8 +31,8 @@ class AccessControl implements MiddlewareInterface
|
||||
$response = json(['code' => $code, 'msg' => $msg, 'data' => []]);
|
||||
} else {
|
||||
if ($code === 401) {
|
||||
$response = response('<script> if (self !== top) { parent.location = "/app/admin"; }</script>',401);
|
||||
//$response = response('',301, ['Location'=> '/app/admin/index/index']);
|
||||
$response = response('<script> if (self !== top) { parent.location = "'.admin_path().'"; }</script>',401);
|
||||
//$response = response('',301, ['Location'=> admin_path().'/index/index']);
|
||||
} else {
|
||||
$request->app = '';
|
||||
$request->plugin = 'admin';
|
||||
|
||||
@@ -26,7 +26,8 @@ class Config implements MiddlewareInterface
|
||||
$config['debug'] = config('app.debug');
|
||||
$config['controller'] = $request->controller_name;
|
||||
$config['action'] = $request->action_name;
|
||||
$config['moduleurl'] = '/app/admin';
|
||||
$config['moduleurl'] = admin_path();
|
||||
$config['admin_path'] = admin_path();
|
||||
$request->_view_vars = array_merge((array) $request->_view_vars,[
|
||||
'user' => session('admin'),
|
||||
'config' => $config
|
||||
|
||||
Reference in New Issue
Block a user