ssdfdsf
This commit is contained in:
@@ -13,6 +13,18 @@ $projectRoot = dirname(__DIR__, 3);
|
||||
$keycloakConfig = ConfigLoader::load($projectRoot, 'keycloak');
|
||||
$auth = new KeycloakAuth($keycloakConfig);
|
||||
|
||||
$assetVersion = static function (string $publicPath) use ($projectRoot): string {
|
||||
$filesystemPath = $projectRoot . '/public' . $publicPath;
|
||||
|
||||
if (!is_file($filesystemPath)) {
|
||||
return $publicPath;
|
||||
}
|
||||
|
||||
$mtime = filemtime($filesystemPath);
|
||||
|
||||
return $mtime === false ? $publicPath : $publicPath . '?v=' . $mtime;
|
||||
};
|
||||
|
||||
if (!$auth->shouldShowDesktop()) {
|
||||
header('Location: /auth/login', true, 302);
|
||||
exit;
|
||||
@@ -23,7 +35,7 @@ if (!$auth->shouldShowDesktop()) {
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Mining-Checker</title>
|
||||
<link rel="stylesheet" href="/assets/apps/mining-checker/app.css">
|
||||
<link rel="stylesheet" href="<?= htmlspecialchars($assetVersion('/assets/apps/mining-checker/app.css'), ENT_QUOTES) ?>">
|
||||
</head>
|
||||
<body>
|
||||
<main class="mining-app" id="mining-checker-app">
|
||||
@@ -159,6 +171,6 @@ if (!$auth->shouldShowDesktop()) {
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script src="/assets/apps/mining-checker/app.js"></script>
|
||||
<script src="<?= htmlspecialchars($assetVersion('/assets/apps/mining-checker/app.js'), ENT_QUOTES) ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user