修复本地开发base标签问题,添加内联脚本提前移除

This commit is contained in:
2026-06-02 20:39:28 +08:00
parent d9c0b6ade9
commit 94d9680174
6 changed files with 40 additions and 0 deletions

11
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"liveServer.settings.port": 5500,
"liveServer.settings.root": "/",
"liveServer.settings.CustomBrowser": "chrome",
"liveServer.settings.NoBrowser": false,
"liveServer.settings.ignoreFiles": [
".git",
"**/*.sass",
"node_modules"
]
}

View File

@@ -527,3 +527,17 @@ body {
.section-title {
animation: fadeInUp 0.6s ease-out;
}
.card-image placeholder-img img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
og-image.jpg img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}

BIN
images/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
images/航拍图.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -21,6 +21,21 @@
<!-- Base Path for Subdirectory Deployment -->
<base href="/g2026/g4/">
<!-- Smart Path Detection - Must run before CSS/JS loading -->
<script>
(function() {
const hostname = window.location.hostname;
// 本地开发环境自动移除 base 标签
if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '') {
const baseTag = document.querySelector('base');
if (baseTag) {
baseTag.remove();
console.log('🔧 Local dev mode: base tag removed');
}
}
})();
</script>
<!-- Stylesheet -->
<link rel="stylesheet" href="css/style.css">