mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add test page for including vue-based web client
This commit is contained in:
parent
a7bb43c310
commit
cecb8b0f5c
@ -110,6 +110,7 @@ Router::scope('/', function (RouteBuilder $routes) {
|
||||
*/
|
||||
//$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
|
||||
$routes->connect('/', ['controller' => 'Dashboard', 'action' => 'index']);
|
||||
$routes->connect('/client', ['controller' => 'Pages', 'action' => 'display', 'js']);
|
||||
$routes->connect('/server', ['controller' => 'Dashboard', 'action' => 'serverIndex']);
|
||||
//$routes->connect('/', 'https://gradido2.dario-rekowski.de/account', array('status' => 303));
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ class PagesController extends AppController
|
||||
*/
|
||||
public function display(...$path)
|
||||
{
|
||||
|
||||
$count = count($path);
|
||||
if (!$count) {
|
||||
return $this->redirect('/');
|
||||
@ -61,7 +62,14 @@ class PagesController extends AppController
|
||||
if (!empty($path[1])) {
|
||||
$subpage = $path[1];
|
||||
}
|
||||
$this->set(compact('page', 'subpage'));
|
||||
$session = $this->getRequest()->getSession();
|
||||
$result = $this->requestLogin();
|
||||
if($result !== true) {
|
||||
return $result;
|
||||
}
|
||||
$user = $session->read('StateUser');
|
||||
$login_server_session = $this->request->getCookie('GRADIDO_LOGIN', '');
|
||||
$this->set(compact('page', 'subpage', 'user', 'login_server_session'));
|
||||
|
||||
try {
|
||||
$this->render(implode('/', $path));
|
||||
|
||||
14
src/Template/Pages/js.ctp
Normal file
14
src/Template/Pages/js.ctp
Normal file
@ -0,0 +1,14 @@
|
||||
<?php $this->layout = false;?><html>
|
||||
<head>
|
||||
<title>Vue Test</title>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<div id="gradido-vue">Wird geladen...</div>
|
||||
<script type="text/javascript">
|
||||
csfr = "<?= $this->request->getParam('_csrfToken') ?>";
|
||||
user = <?= json_encode($user); ?>;
|
||||
session = <?= $login_server_session ?>;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user